ブロックマスクへの変数表示の方法
9 views (last 30 days)
Show older comments
作成したSimulinkブロックのマスクにモデルワークスペースで設定した変数を表示させたいのですが、
どうすればいいでしょうか。
宜しくお願いします。
0 Comments
Accepted Answer
Atsushi Ueno
on 27 Apr 2022
>作成したSimulinkブロックのマスクにモデルワークスペースで設定した変数を表示させたいのですが、どうすればいいでしょうか。
サブシステムを右クリック⇒マスク⇒マスクの編集(Ctrl+M)⇒「アイコンと端子」タブの「アイコンを描画するコマンド」に下記のコードを記述してください。
MWS = get_param(bdroot,'ModelWorkspace'); % モデルワークスペースの取得
disp(evalin(MWS, 'VarName')); % 変数'VarName'の値をSimulinkブロックのマスクに表示
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!