コマンドで「ブロック注釈」の設定をすることが出来ますか?
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 25 Ott 2013
Risposto: MathWorks Support Team
il 25 Ott 2013
ブロックのブロックプロパティ のブロック注釈のブロックプロパティトークンのプロパティを表示できるよう コマンドで設定するにはどのようにしたらよいのでしょうか。
Risposta accettata
MathWorks Support Team
il 25 Ott 2013
ブロックパラメータ:AttributesFormatString を使用した方法になります。
(例1) サンプル時間の表示設定
set_param(gcb,'AttributesFormatString','ST=%<SampleTime>')
(例2) 条件に応じて表示/非表示を設定
if strcmp(get_param(gcb,'SampleTime'),'-1')
set_param(gcb,'AttributesFormatString','');
else
set_param(gcb,'AttributesFormatString','%<SampleTime>')
end
(上記は、サンプル時間が -1 の場合、SampleTime を ブロック下部に表示しないで、それ以外の場合、表示する)
これらは、ブロックプロパティのコールバック関数:InitFcn に設定します。
なお、パラメータ設定後、[モデルの更新]あるいは、[シミュレーション実行]を行うことで表示が反映されます。
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su モデル、ブロックおよび端子のコールバック in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!