Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

How can I access the value of signals at the time of stopping the simulation.

1 visualización (últimos 30 días)
Kushagra
Kushagra el 12 de En. de 2013
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I want to update the initial values of signals(Simulink.Signal) to the values that these signals hold at the time of stopping the simulation.
All the signals that I use are defined in Matlab workspace.

Respuestas (2)

Azzi Abdelmalek
Azzi Abdelmalek el 12 de En. de 2013
Don't stop your simulation, just pause it
set_param('yourmodel','SimulationCommand','pause')
To continue simulation
set_param('model','SimulationCommand','continue')
  1 comentario
Kushagra
Kushagra el 16 de En. de 2013
I need to stop and simulate model again because after updating values, I want default transitions in stateflow to be executed again. If I pause and then continue the simulation, stateflows will maintain their present state (Once stateflow flow is activated, it can go in sleep but cannot become inactive in that simulation).

Kaustubha Govind
Kaustubha Govind el 14 de En. de 2013
Perhaps you can use the model callback StopFcn to update the workspace using simple MATLAB code?
  2 comentarios
Kushagra
Kushagra el 16 de En. de 2013
Actually I am not able to access the values of those signals through code. Could you please help me with that.
TAB
TAB el 16 de En. de 2013
Can you post the code you have are using ?

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by