MATLAB Answers


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

Asked by Kushagra
on 12 Jan 2013

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.


2 Answers

Answer by Azzi Abdelmalek
on 12 Jan 2013

Don't stop your simulation, just pause it


To continue simulation


  1 Comment

on 16 Jan 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).

Answer by Kaustubha Govind
on 14 Jan 2013

Perhaps you can use the model callback StopFcn to update the workspace using simple MATLAB code?


on 16 Jan 2013

Actually I am not able to access the values of those signals through code. Could you please help me with that.

on 16 Jan 2013

Can you post the code you have are using ?

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today