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.
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.