Initialize関数のカスタマイズ

Simulinkモデル内の、サブシステムをInitialize関数の処理として組み込みたい場合、どのようにすればいいでしょうか。

답변 (1개)

Toshinobu Shintai
Toshinobu Shintai 2021년 1월 6일

0 개 추천

Simulinkライブラリブラウザーの「Simulink」「User-Defined Functions」にある「Initialize Function」ブロックを使うことで実現できます。
添付ファイルにサンプルモデルを作成してみました。「my_system.slx」は、Embedded Coderでコード生成する設定がなされていますので、コード生成すると、「Initialize Function」ブロックの中の処理がmy_system_initialize関数の中に記述されます。
モデルはR2020bで作成しました。

댓글 수: 2

直樹 田中
直樹 田中 2021년 1월 6일
ご回答ありがとうございます。
ver記入漏れていたのですが、サンプルモデルを2019bでも頂けると助かります。
Toshinobu Shintai
Toshinobu Shintai 2021년 1월 6일
R2019bに変換して再度添付しました。

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 コード生成에 대해 자세히 알아보기

질문:

2021년 1월 6일

댓글:

2021년 1월 6일

Community Treasure Hunt

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

Start Hunting!