Is it possible to change a workspace value during simulation?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ramya
el 19 de Abr. de 2013
Respondida: Moussaoui Aghiles
el 28 de Dic. de 2020
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 comentarios
Respuesta aceptada
Kaustubha Govind
el 19 de Abr. de 2013
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 comentario
Jaydip Davara
el 11 de Jun. de 2019
set_param('modelname', 'SimulationCommand', 'update') is not working for me. Do you any other suggestions/idea that could help me do this task?
Más respuestas (2)
Sysenso Systems
el 20 de Abr. de 2013
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 comentarios
Moussaoui Aghiles
el 28 de Dic. de 2020
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 comentarios
Ver también
Categorías
Más información sobre Simulink Functions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!