MATLAB: How to forbid opening of two copies of Matlab? Is it possible

parallel computingpreferences

The second time I clicked on the icon of the program, run another copy. Can I set Matlab to a second copy does not run when I click on the icon again?

Best Answer

You could add some code to the startup.m file to close Matlab automatically, when another instance is running already. But this code runs after the long initialization phase, but I assume you want the existing instance to be activated immediately.
Then there is no clean solution, because this behavior concerns other programs also and is controlled by the OS. But you can emulate this behavior by replacing the original Icon by a small batch script or application, which checks for an open instance and activates it on demand. This is not really complicated, but take some hours to implement. Is it really worth to implement a non-standard behavior, which might be more confusing then useful?
Related Question