How to improve the running speed after converting to code by setting the properties in the Simulink model?
1 view (last 30 days)
Show older comments
After using the C coder to convert the model, I hope that the code can run as quickly as possible without affecting its functionality. Which settings in the properties should I consider? Can functions like inline functions or anything else have a certain effect? Because I found that checking or not to check the inline function function function can result in vastly different numbers and formats of generated files. So, will optimizing the code in this way cause some other unknown problems in code generation due to uncontrollable factors?
0 Comments
Accepted Answer
Ganesh
on 6 Aug 2024
Edited: Ganesh
on 6 Aug 2024
The best way to go about your problem is to have a look at the Code Efficiency Page, for which I am attaching the documentation below:
Each parameter you set will affect your code depending on the model you are using.
If you are using Embedded Coder, you optimize the code in a generic fasion by setting the "Optimization Level" parameter to be "maximum". This would imply that the optimization is to be made keeping code generation parameters in mind. You could also go through the parameters specifically and understand if they will have an effect on your model or not. Do note that you will be disabling debugging by doing so. Attaching the documentation of "Optimization Level" parameter to give you a better understanding:
Hope this helps!
More Answers (0)
See Also
Categories
Find more on Simulink Coder in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!