Effacer les filtres
Effacer les filtres

ブロックマスクへの変数表示の方法

1 vue (au cours des 30 derniers jours)
kkdra57
kkdra57 le 27 Avr 2022
Commenté : kkdra57 le 28 Avr 2022
作成したSimulinkブロックのマスクにモデルワークスペースで設定した変数を表示させたいのですが、
どうすればいいでしょうか。
宜しくお願いします。

Réponse acceptée

Atsushi Ueno
Atsushi Ueno le 27 Avr 2022
>作成したSimulinkブロックのマスクにモデルワークスペースで設定した変数を表示させたいのですが、どうすればいいでしょうか。
サブシステムを右クリック⇒マスク⇒マスクの編集(Ctrl+M)⇒「アイコンと端子」タブの「アイコンを描画するコマンド」に下記のコードを記述してください。
MWS = get_param(bdroot,'ModelWorkspace'); % モデルワークスペースの取得
disp(evalin(MWS, 'VarName')); % 変数'VarName'の値をSimulinkブロックのマスクに表示
  1 commentaire
kkdra57
kkdra57 le 28 Avr 2022
添付のスクリプトを試したところ、マスクに変数が表示されました。
ありがとうございます。

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Author Block Masks dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!