simulink clears workspace after being run with GUI
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
It seems that simulink uses a different workspace or clears the current workspace after being run from the GUI.
I have the following setup:
A gui.m file which calls a Model_driver file using the run function after a button is clicked. The Model Driver then uses sim() to run the simulink model. As soon as sim() is called, the workspace clears and all my variables are undefined. However, when I run the model from the Model Driver file everything works fine.
I found on the mathworks site the following function:
options = simset('SrcWorkspace','current');
This DOES SEEM to work but then my entire workspace is still empty after it finishes and I kinda do need those variables to do further calculations after it is done.
How would I go about doing this?
Thanks!
1 Kommentar
Walter Roberson
am 5 Nov. 2012
Please use better tags for this question; see http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags
Antworten (1)
Kaustubha Govind
am 24 Okt. 2012
Try:
options = simset('SrcWorkspace','current', 'DstWorkspace', 'current');
0 Kommentare
Siehe auch
Kategorien
Mehr zu Event Functions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!