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

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?

 Accepted 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?

2 Comments

Yes, my question may sound strange and useless, but thank you for the detailed answer.
In every case your questions are welcome. It is the nature of problems of other people to sound useless ;-)

Sign in to comment.

More Answers (1)

Why to click a second time on your Matlab icone?, maybe it's in your desktop toolbar. I advise to unpin Matlab shortcut from your toolbar

1 Comment

My question is more theoretical than practical. For example, if you run again Adobe Reader, a new copy is not created, but the window of already running Adobe Reader becomes active. I wanted to know can I configure Matlab similary?

Sign in to comment.

Categories

Asked:

on 18 Sep 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!