how to pass variables from simulink to workspace,when simulink has been paused from MATLAB Script

9 views (last 30 days)
I am running two simulink model from matlab script(with "sim" command),,now i want to pause the running simulink model in the middle and send the data from "to workspace block" to my matlab workspace at the time wen i paused it,,,,,actually my requirmnet is meeting if i directly run my simulink model from simulnk start pause button,,,but its not working through script

Sign in to comment.

Answers (2)

Azzi Abdelmalek
Azzi Abdelmalek on 14 Dec 2012
and your data will be saved to workspace
Azzi Abdelmalek
Azzi Abdelmalek on 17 Dec 2012
Arun, I tested your problem in a loop, and it worked, the initial value of the unit delay don't change when you pause simulation. I don't know why it don't work for you.

Sign in to comment.

TAB on 14 Dec 2012
@Arun, I hope that you don't have any strange varsion of matlab (like Matlab R. Strange).
sim() command will not return till simulation is completed, so off-course your script will never go ahead to execute other commands like pause.
And, see below snap. When I run and pause the model from script using SimulationCommand, then To Workspace block output is saved in workspace. It should work for you also.

Sign in to comment.


Find more on Manual Performance Optimization in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!