Toggle manual switch through m-file script
9 ビュー (過去 30 日間)
古いコメントを表示
Eduardo Rey
2012 年 4 月 24 日
編集済み: Sergio Enrique Pinto Castillo
2022 年 5 月 20 日
I want to toggle the manual switch block in Simulink using an m-file script.
....my model file is called "ecg_filter" and the manual switch is called "sw1", so I wrote in the m-file: set_param('ecg_filter/sw1','varsize','off') but the switch did not change positions, what am I doing wrong?
I have already looked at the following answer at: http://www.mathworks.es/matlabcentral/answers/32167-controlling-manual-switch-through-m-file
採用された回答
Kaustubha Govind
2012 年 4 月 24 日
The parameter is called 'sw', not 'varsize'. You need to use:
>> set_param('ecg_filter/sw1', 'sw', '0')
>> set_param('ecg_filter/sw1', 'sw', '1')
4 件のコメント
Chetan Sharma
2018 年 8 月 23 日
Hi people. How did you find that the parameter is called 'sw'? I am trying to use same kind of parameter in manual variant sink block but unable to find a parameter for the same. Thank you. :)
Sergio Enrique Pinto Castillo
2022 年 5 月 20 日
編集済み: Sergio Enrique Pinto Castillo
2022 年 5 月 20 日
How did you change the position of the toggle swicth using the value of output in a simulink block?
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!