コマンドで「ブロック注釈」の設定をすることが出来ますか?
8 views (last 30 days)
Show older comments
MathWorks Support Team
on 25 Oct 2013
Answered: MathWorks Support Team
on 25 Oct 2013
ブロックのブロックプロパティ のブロック注釈のブロックプロパティトークンのプロパティを表示できるよう コマンドで設定するにはどのようにしたらよいのでしょうか。
Accepted Answer
MathWorks Support Team
on 25 Oct 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 Comments
More Answers (0)
See Also
Categories
Find more on モデル、ブロックおよび端子のコールバック in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!