コード生成時にconst修飾子を追加するにはどうすればよいですか?
2 views (last 30 days)
Show older comments
MathWorks Support Team
on 25 Oct 2013
Answered: MathWorks Support Team
on 25 Oct 2013
ブロック内で使用するパラメータが、コード生成時にグローバル変数として定義されてしまい、RAM領域が使用されてしまいます。const修飾子を追加することでROM領域を使用する方法を教えてください。
Accepted Answer
MathWorks Support Team
on 25 Oct 2013
Simulinkデータオブジェクトを使用し、Storage Classを「Const」に設定することで生成コードに const を付加することができます。
ページ下部の 関連ドキュメント よりサンプルモデルをダウンロードすることができます。
サンプルモデルでは、Lookup Tableブロックのパラメータをmpt.Parameterで定義しており、コード生成を行うとadd_const.cにconst修飾子付きでデータが定義されます。
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!