How do I increase simulation speed for Simulink models that have Embedded MATLAB Function blocks?

3 views (last 30 days)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
For simulation, the debug instrumentation will make Embedded MATLAB a bit slower. Turning off debugging will help the problem.
1. Start model explorer. From Simulink model windows, select "View" -> "Model Explorer".
2. Click on the model name. This should be right below "Configuration Preferences"
3. Click on the Contents window, scroll all the way to the bottom and select "sfun"
4. Click on the "Coder Options" button and uncheck "enable debugging/animation"
If you are using Simulink 6.3 (R14SP3) or later, you can also turn debugging on and off for individual Embedded MATLAB blocks using the Embedded MATLAB Editor. To do so, open the Embedded MATLAB Editor (by double-clicking on the block) and select the "Debug -> Enable Debugging" option to toggle the use of debugging. This option will be greyed out if debugging has been disabled for all Embedded MATLAB blocks using the method described above.

More Answers (0)

Categories

Find more on Modeling in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!