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

3 次查看(过去 30 天)
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!

回答(1 个)

Walter Roberson
Walter Roberson 2016-1-8
编辑:Walter Roberson 2016-1-8
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.

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by