Can I run the same script (and subfunctions) from two diffent matlab windows?
25 views (last 30 days)
I have a script that calls subfunctions. I am wondering if I'll run into any problems when I call the script and hence the subfunctions from two different matlabs. The background is that I am running an optimization. I want to optimize two different sets of data independently meaning calling the optimization script from to different matlabs. Will I have problems when the script calls the subfunction which is executing the simulation? For example that input/output parameters will get messed up this way among the different matlabs. Or is matlab using some temporary versions of all called scripts and functions per workspace/matlab window?
I'd really appreciate any answers/hints/help on this.
Guillaume on 4 Dec 2015
Edited: Guillaume on 4 Dec 2015
Scripts and functions are simply text files. They are not executables. So, yes They can be run without any issue(*) from as many matlab sessions as you want. Each matlab session will read the script/functions, and execute them in their own workspace.
*: unless of course, your script writes data to a fixed file, in which case both instances would overwrite each other data.