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

9 visualizzazioni (ultimi 30 giorni)
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!

Risposte (1)

Walter Roberson
Walter Roberson il 8 Gen 2016
Modificato: Walter Roberson il 8 Gen 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.

Categorie

Scopri di più su Modeling in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by