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

1 回表示 (過去 30 日間)
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?

採用された回答

Ganesh
Ganesh 2024 年 8 月 6 日
編集済み: Ganesh 2024 年 8 月 6 日
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 件のコメント
peter
peter 2024 年 8 月 6 日
@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.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by