How to open mat file into runing matlab.exe without opening a new one?
3 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Abhishek Pandey
2015 年 7 月 17 日
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
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!