Is it possible to change a workspace value during simulation?
조회 수: 4 (최근 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!