
別ファイルで#define定義されたマクロのインクルードするための設定方法
18 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
EmbeddedCoderによってコード生成する際に、既存の別ファイルで#define定義されたマクロを利用するために、simulink上のパラメータの設定をどのようにすればいいでしょうか?

0 Kommentare
Antworten (1)
Toshinobu Shintai
am 24 Dez. 2020
Bearbeitet: Toshinobu Shintai
am 24 Dez. 2020
サンプルモデルを作成しました。添付ファイルをご確認ください。モデルはR2019bで作成しました。
Simulinkデータディクショナリにて、Simulink.Parameterで「UPPER」「LOWER」という変数を作成しました。
コード生成オプションで、ストレージクラスを「InportedDefine」として、カスタム属性に、そのdefineが定義されている(はずの)ヘッダーファイルを指定しています。

これにより、コード生成されたファイル内にはdefineを含まない形で、パラメータをdefineで扱うことができます。
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!