MATLAB Answers

Running simulink from GUI, Outputs will not be saved in workspace!!

18 views (last 30 days)
Ali bbbb
Ali bbbb on 8 Jan 2016
Edited: Walter Roberson on 8 Jan 2016
HI everyone,
I have a simulink file, which I want to run with a push button from GUI, I have used the following lines for the call back function:
simOut = sim('Final_Version','SimulationMode','Normal','AbsTol','1e-5',...
'SaveState','on','StateSaveName','xoutNew',...
'SaveOutput','on','OutputSaveName','youtNew');
my problem is that, when I'm running the simulink file from GUI the blocks that I have set to be saved in workspace doesn't come in the workspace, However when I run the simulink file directly, they appear in workspace! can anyone help me with this??
thanks in advanced!

  0 Comments

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 8 Jan 2016
Edited: Walter Roberson on 8 Jan 2016
When you start a model from the menus or graphically, then "To Workspace" writes to the Base workspace.
When you start a model from code by calling sim() then "To Workspace" writes to the workspace of the function that makes the call. That function might choose to then assignin('base') the values if it wants them in the base workspace.

  0 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!