Need helps for data disappear after running "sim"
2 views (last 30 days)
Show older comments
Hello everyone, I am a simulink learner. I have one problem with date save related with "sim". Thank you for helping. Problem statement: When running the "sim('model')", the variables names of the simulink model can be seen in the matlab base Workspace. But when "sim" command is completed and continues to the following codes, all those mdl variables disappear from the workspace, even the "save to space" ports are set in simulink model. I do not how to solve this problem. Thanks for any suggestion and help!
0 Comments
Accepted Answer
Andreas Goser
on 5 Aug 2011
3 Comments
Andreas Goser
on 5 Aug 2011
I am afraid your descriptions confuse me. The SIM command is used when you want to control simulations through MATLAB, e.g. for parameter studies. Your description is not clear to me, but it sounds like it is a valid reason to work with SIM.
Now to the masked subsystems. I do not see a reason why this matters.
About the returned data. When you use "To Workspace" blocks, the data will be in the base workspace. Maybe your MATLAB Code is a function and not a script and thus, the return data is in the function's workspace.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!