Is there a clever way to isolate Simulink Parameter callback workspace?
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.
Respuestas (1)
Sujit Muduli
el 6 de Mzo. de 2018
0 votos
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
Jason Nicholson
el 6 de Mzo. de 2018
Editada: Jason Nicholson
el 6 de Mzo. de 2018
Jason Nicholson
el 2 de Mayo de 2018
Categorías
Más información sobre Using MATLAB Projects in Simulink en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!