Is there a clever way to isolate Simulink Parameter callback workspace?
1 view (last 30 days)
Show older comments
The run command runs a script in the caller workspace. That got me thinking that there might be a clever way to run code in Simulink Parameter callback in an isolated workspace. I don't like the fact that the Parameter callbacks pollutes the base workspace. Variable collision(s) is unlikely but it is messy when callbacks are complicated.
Suggestions?
EDIT: One file is preferred. Right now I am restricted to use a single Simulink file otherwise I would just use a MATLAB function for the functionality I am looking for.
0 Comments
Answers (1)
Sujit Muduli
on 6 Mar 2018
Hi Jason, You may want to use Model Workspace or a Data dictionary if you don't want to pollute your base workspace. However, there is one alternative approach. You may create a MATLAB Function to perform all the calculations and since each MATLAB function has its own workspace it won't pollute your base workspace. You may also find the links below useful to do operations in different workspaces.
2 Comments
See Also
Categories
Find more on Simulink Functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!