Finding Object Parameters for controlling Simulink object through "set_param()"
10 ビュー (過去 30 日間)
古いコメントを表示
I was looking at controlling (toggling) the "manual switch" block in Simulink through M-scripts (matlab commands).
I was able to do so using the following command:
set_param(gcb, 'sw','0');
set_param(gcb, 'sw','1');
I was able to Google the right parameter (as listed above) in case for manual switch.
Now the question is, from where do I find that manual switch" has a parameter of "sw" to control it using the set_param() function?
I've tried
get_param(gcb, 'DialogParameters')
get_param(gcb, 'ObjectParameters')
Both the above functions doesn't list "sw" as a parameter for "manual switch".
I'm using Simulink on Matlab R2012b
0 件のコメント
回答 (2 件)
Graham Fletcher
2014 年 4 月 22 日
Hi Jeevan,
I think
get(gcbh)
and
set(gcbh, 'sw', '0')
will do what you're after.
HTH, G.
Rangan M K
2016 年 5 月 11 日
Hi Jeevan, I tried get_param(gcb, 'DialogParameters') and get_param(gcb, 'ObjectParameters')
Both of them show a parameter called sw in Matalb2010b. Even the BlockProperies>BlockAnnotations of Mannual Switch shows %<sw> in it.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Programmatic Model Editing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!