Is there a way to run multiple .m files in different instances of MATLAB concurrently through a batch file? The task that I want to accomplish is like below:
Open x instances of MATLAB;
Let different instances run different .m files simultaneously (so that my CPU power could be completely utilized);
When all instances finish, exit all MATLAB.
Could a single batch file accomplish this process? The reason I want to use a single batch file to do so is that I want to call this batch file in my MATLAB script. Essentially, I want to do parallel computation. (Since some of my scripts have to be run with MATLAB 2007, which doesn't have the parallel computing toolbox, I have to find a way around.)
Please explain the syntax of your code since I know little about the command prompt.
Currently, I only know how to do the task in sequence, just like the code shown below.
cd "C:\My_MATLAB_folder_path"
matlab r- "mfile01;exit"
matlab r- "mfile02;exit"
...
matlab r- "mfilexx;exit"
If a command prompt could not achieve this process, what alternative methods could I use? One important thing is that whatever method may be used, it must be able to be called in a MATLAB script.