Is there a clever way to isolate Simulink Parameter callback workspace?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Sujit Muduli
el 6 de Mzo. de 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 comentarios
Ver también
Categorías
Más información sobre Simulink Functions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!