-1

Is there an alternative function to the sim() command oder a direct way executing a Simulink Model / a compiled version of it from Matlab without setting coder.extrinsic?

I want to execute a simulink model inside of an iterative Matlab-function. (Hence, speed matters dramatically). The used Simulink model contains a Dymola interface and hence, I cannot model it directly in Matlab. Another main Simulink model starts and iterates the Matlab functions and hence, simulating it leads the coder trying to compile it efficiently. By setting coder.extrinsic, of course I can use the sim command, but it is way too slow for its purpose. I thought about compiling the Simulink model as an alternative, but do not know if this would be a good approach

The structure looks as follows:

Simulink main model -> matlab functions -> simulink model

1 Answers1

1

sim command needs MATLAB. So you need coder.extrinsic. There is no direct alternate way without coder.extrinsic to simulate a model. You can generate code from the model and call the generate code using coder.ceval functions. But if your goal is only to get more speed instead of getting stand-alone code you can set your model to run in accelerator mode and see whether that improves speed.

Navan
  • 4,407
  • 1
  • 24
  • 26
  • 1
    Use the rapid accelerator mode, not the accelerator mode. The rapid accelerator mode creates a standalone executable which bundles solver and model, which is the fastest way for execution. – Daniel Jan 08 '16 at 18:02