How to improve the running speed after converting to code by setting the properties in the Simulink model?

1 vue (au cours des 30 derniers jours)
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?

Réponse acceptée

Ganesh
Ganesh le 6 Août 2024
Modifié(e) : Ganesh le 6 Août 2024
Hi @peter,
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!
  1 commentaire
peter
peter le 6 Août 2024
@GaneshThank you very much for your help and the documents listed. I will carefully read these documents and immediately start trying to compare these parameters.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Simulink Coder dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by