Tool of the Week: Running Multiple Instances of Matlab on Mac

Notice There are two Matlabs Running!

My research often involves running Matlab Code that can take hours to run. Admittedly, Matlab isn't the fastest language out there, but it has super powerful debugging tools, and image processing packages that make it really easy to use for a non-computer scientist.

While matlab is running a bit of code, it won't let you do anything else, it just tells you it is "busy" at the bottom. Even editing other bits of code in the editor, as well as opening and saving files, can be sluggish to impossible while matlab is running. But I can't just sit around and wait while matlab is running, I've got graduating to do! On PCs, I remember running Multiple instances of matlab to be pretty straight forward. You could just click the matlab icon and a new instance would launch.

On Mac, it's not quite as easy. I find the best way to open a new instance is through the terminal. Go to Applications/Utilities/Terminal to launch the terminal (Or drag it to your Dock because it's a pretty useful tool!). When the command prompt is ready, simply enter in the command:

/Applications/Research/MATLAB_R2011b.app/bin/matlab

(NOTE: This might be different if your install of matlab is a different version or in a different location).

The terminal should launch another instance of Matlab (Note: if your matlab is installed in a different location, or is a newer version, you may need to edit this command). I like to keep the two instances of matlab, along with their editors, on separate desktops to keep them apart in my head. Note: Don't close the terminal window, because it is connected with this instance of matlab. If you'd like to open yet another instance, you'll need to open a new terminal window and repeat the command.

If you're running pretty intense code, it might do you good to run the activity monitor to watch your memory and cpu usage, as well as close other programs (even your web browser).

I almost always run matlab this way, because if it crashes or gets stuck and ctrl-c won't break it, i can exit it by closing the terminal!