Is there a clever way to isolate Simulink Parameter callback workspace?
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Sujit Muduli
2018-3-6
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!