In case it's helpful, the "try, catch" blocks in loadcase.m are primarily about attempting to load case files in certain formats and retrying other formats if you don't get what you expect. If you know that you will only be loading case files as valid M-file (or MAT-file) case files in version 2 format, you can replace loadcase.m with a trivial function that calls the appropriate M-file function or loads the MAT-file and returns the case struct.
-- Ray Zimmerman Senior Research Associate B30 Warren Hall, Cornell University, Ithaca, NY 14853 phone: (607) 255-9645 On Jul 24, 2013, at 3:39 AM, Shri <abhy...@mcs.anl.gov> wrote: > Sorry, forgot to include the thread link. Here it is > http://stackoverflow.com/questions/13168346/rms-not-supported-in-matlab-function-inside-simulink > > Shri > On Jul 23, 2013, at 6:24 PM, Fang-Yu Liu wrote: > >> Hi Shri, >> >> Thanks for your prompt respond. >> But what do you mean by use 'extrinsic'? >> How can I do that? >> >> Thanks, >> Fang-Yu >> >> Shri 於 2013/7/23 下午9:12 寫道: >> >>> This stackoverflow post states that some functions, these could be even >>> matlab built-in functions, cannot generate auto-code. It suggests the use >>> of 'extrinsic' to avoid this issue. >>> >>> Shri >>> >>> On Jul 23, 2013, at 5:31 PM, Fang-Yu Liu <fan...@mit.edu> wrote: >>> >>>> Hi all, >>>> >>>> I'm trying to add power flow analysis to my simulink model. >>>> I added a MATLAB function in simulink and run matpower command such as >>>> load case, runpf, eta. >>>> However, I received this errors: >>>> >>>> Try and catch are not supported for code generation. >>>> >>>> >>>> Function 'loadcase.m' (#54.4881.5039), line 129, column 13: >>>> "try \\%% assume it returns a struct" >>>> Launch diagnostic report. >>>> Does anybody familiar with running matpower in Simulink? Could you guys >>>> give me some hints about how should I fix it? >>>> Thanks! >>>> >>>> Fang-Yu >> >