Is it possible to change a workspace value during simulation?
3 ビュー (過去 30 日間)
古いコメントを表示
I have a variable defined as scope parameter inside stateflow and i defined the value of that parameter in workspace. While running, shall i able to pause the simulation and change the value in workspace?
0 件のコメント
採用された回答
Kaustubha Govind
2013 年 4 月 19 日
Yes, that should be possible as long the the parameter is marked as tunable (which it is by default, I think). You will need to run Ctrl+D on the model or set_param('modelname', 'SimulationCommand', 'update') after changing the workspace value to ensure that Simulink notices the new value.
1 件のコメント
Jaydip Davara
2019 年 6 月 11 日
set_param('modelname', 'SimulationCommand', 'update') is not working for me. Do you any other suggestions/idea that could help me do this task?
その他の回答 (2 件)
Sysenso Systems
2013 年 4 月 20 日
If you want to make the change without updating the model, you may need to set "add_exec_event_listener" to the block which has the tunable parameter and you can change the value through a callback. Please read >> help add_exec_event_listener.
0 件のコメント
Moussaoui Aghiles
2020 年 12 月 28 日
HiI have a problem I can not get the desired value with 'to workspace', or instead of having 3 value I find 51 mrc
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Simulink Functions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!