How to open mat file into runing matlab.exe without opening a new one?
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hesham Ismail
il 10 Lug 2015
Commentato: Hesham Ismail
il 20 Lug 2015
Hello ,
I have a m-file. Whenever i click on it matlab opens, which is fine.
The problem is, if I have matlab open already it open another one.
I just want to open m-file in the existing matlab (if matlab.exe is already running) not sure how to fix this?
0 Commenti
Risposta accettata
Abhishek Pandey
il 17 Lug 2015
Hi Hesham,
In order to open a MAT-file using an existing session of MATLAB, follow the steps below:
If you’re running Windows XP or Vista, the following commands in MATLAB will reconfigure the associations of MATLAB-file for Windows for versions R2013a or earlier:
cd([matlabroot '\toolbox\matlab\winfun\private']);
fileassoc('add', {'.m','.mat','.mdl','.slx','.fig','.p','.mlprj'})
For versions R2013b or later, the path to fileassoc is instead:
cd([matlabroot '\mcr\toolbox\matlab\winfun\private']);
Note that, MATLAB must run with administrator privileges in order to perform the registry changes. So you will need to start MATLAB as Administrator, run the code above, and then quit MATLAB. Then try to open a MATLAB file via Windows explorer once to verify that MATLAB starts and then try to open another MATLAB file and verify that a second instance of MATLAB does not get started.
If this does not work, then check to make sure that you are not always running MATLAB with administrator privileges enabled. If so, then Windows itself (with User Account Control - UAC) is the actual cause of the problem. Windows (with UAC) will not allow the explorer to send DDE (Dynamic Data Exchange) messages to a process running with administrator privileges enabled.
I hope this helps!
- Abhishek
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!