Initialize関数のカスタマイズ

5 Ansichten (letzte 30 Tage)
直樹 田中
直樹 田中 am 6 Jan. 2021
Simulinkモデル内の、サブシステムをInitialize関数の処理として組み込みたい場合、どのようにすればいいでしょうか。

Antworten (1)

Toshinobu Shintai
Toshinobu Shintai am 6 Jan. 2021
Simulinkライブラリブラウザーの「Simulink」「User-Defined Functions」にある「Initialize Function」ブロックを使うことで実現できます。
添付ファイルにサンプルモデルを作成してみました。「my_system.slx」は、Embedded Coderでコード生成する設定がなされていますので、コード生成すると、「Initialize Function」ブロックの中の処理がmy_system_initialize関数の中に記述されます。
モデルはR2020bで作成しました。
  2 Kommentare
直樹 田中
直樹 田中 am 6 Jan. 2021
ご回答ありがとうございます。
ver記入漏れていたのですが、サンプルモデルを2019bでも頂けると助かります。
Toshinobu Shintai
Toshinobu Shintai am 6 Jan. 2021
R2019bに変換して再度添付しました。

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!