コマンドで「ブロック​注釈」の設定をするこ​とが出来ますか?

8 Ansichten (letzte 30 Tage)
MathWorks Support Team
MathWorks Support Team am 25 Okt. 2013
ブロックのブロックプロパティ のブロック注釈のブロックプロパティトークンのプロパティを表示できるよう コマンドで設定するにはどのようにしたらよいのでしょうか。

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 25 Okt. 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 に設定します。
なお、パラメータ設定後、[モデルの更新]あるいは、[シミュレーション実行]を行うことで表示が反映されます。

Weitere Antworten (0)

Kategorien

Mehr zu モデル、ブロックおよび端子のコールバック finden Sie in Help Center und File Exchange

Produkte


Version

R2009b

Community Treasure Hunt

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

Start Hunting!