How to restore file association in Matlab 2015a for Windows
Ältere Kommentare anzeigen
The Matlab files are no more associated with Matlab.
In the previous version I have run the Application as Administrator and typed these commands
cwd=pwd;
cd([matlabroot '\toolbox\matlab\winfun\private']);
fileassoc('add',{'.m','.mat','.fig','.p','.mdl',['.' mexext]});
cd(cwd);
disp('Windows file associations changed. FIG, M, MAT, MDL, MEX, and P files are now associated with MATLAB.')
If I try the same in Matlab R2015a doesn't work and give me the error Undefined function or variable 'fileassoc'.
If I try to associate the file type using right click directly on the .m file and choosing open with Matlab with the use always option enabled, the files appears associated but when I try to open the file, Matlab starts but doesn't open the file so I'm forced to start Matlab and open de file from open menu.
How could I fix this problem?
What happened to fileassoc command?
I'm on Windows 8.1 x64
1 Kommentar
Yun Li
am 1 Jun. 2016
add \mcr before \toolbox will fix this problem
Akzeptierte Antwort
Weitere Antworten (5)
Yannis Gr.
am 16 Jun. 2016
Bearbeitet: Yannis Gr.
am 16 Jun. 2016
13 Stimmen
A bit more help on how you should do this.
2)Extract the file @ C:\Program Files\MATLAB\R2016a\mcr\toolbox\matlab\winfun\private . Change the R2016a according your version of course.
3)Navigate inside matlab to the same dir as above. (Run matlab as admin also)
4)Execute the command associateFiles('add',{'.m','.mat','.fig','.p','.mdl',['.' mexext]});
5)Take the .reg file it will create copy paste on desktop and run it.
8 Kommentare
Jonathan
am 5 Nov. 2016
Thanks!!!! Problems solved on win10!
Tan
am 14 Feb. 2017
Thanks !!
Diaa
am 22 Mär. 2017
Thanks
It works perfectly for MATLAB R2017a on Windows 10
Islam Alam
am 5 Apr. 2017
Bearbeitet: Walter Roberson
am 3 Jan. 2018
Thanks
%%This is the part which works with most of MATLAB File associations
associateFiles('add',{'.m', '.mat', '.fig', '.p', '.mexw64', '.mlapp', '.mltbx', '.mldatx', '.req', '.mlappinstall', '.mlpkginstall', '.mdlp', '.slxp', '.mdl', '.slx', '.sltx', '.ssc', '.mn', '.mu', '.muphlp', '.xvc', '.xvz', '.sldd', '.slddc',['.' mexext]});
daoda han
am 7 Mai 2017
thanks
Joao Lizárraga
am 22 Jul. 2017
It worked for me! I'm using the R2017a version.
Thanks.
Cosmin Constantin Popescu
am 21 Mai 2018
It worked by it required to unzip the archive directly in the specified folder (and in a new folder but that was just a default in my case). When I first run the registry file, I had a MATLAB instance open and the .m files opened externally ignored it. Instead, they all opened in a second MATLAB instance. At least that instance now behaves as expected. Thank you for the help and explanations!
mehmed celebi
am 30 Okt. 2018
Thanks so much for your professional help
Murat Ates
am 20 Mär. 2015
Copying 3 fileassoc files from
C:\Program Files\MATLAB\R2014b\mcr\toolbox\matlab\winfun\private
to the corresponding R2015a folder and running
fileassoc('add',{'.m','.mat','.fig','.p','.mdl',['.' mexext]});
on 2015a in the corresponding folder worked for me. Then you are able to see R2015a in the Windows default programs list i.e.
Control Panel\All Control Panel Items\Default Programs\Set Default Programs
Matlab starter's icon disappeared though. I checked registry of Windows, and command just mirrored whatever is done for 2014b to 2015a.
If you don't have those 3 files, you may export registry settings for Matlab in 2014b, modify and run it if you installed 2014b on that machine. Backup whole registry before doing this. Registry settings are located at:
HKEY_LOCAL_MACHINE\SOFTWARE\MathWorks\R2015a
1 Kommentar
Andrew Farsech
am 22 Mär. 2015
cai6328
am 3 Mär. 2016
0 Stimmen
It worked for me. THanks
federica cirillo
am 31 Jan. 2018
Bearbeitet: federica cirillo
am 31 Jan. 2018
0 Stimmen
it doesn't work for me! I obtain "Failed to create registry file". can you help me? I'm using R2017a version
1 Kommentar
Quentin Guillaumin
am 2 Jul. 2018
I had the same issue, add a path to indicate where to save the registry such as 'C:\Users\bob\Downloads\regisry' in the fileStr entry of the function, I worked for me.
Rehan Qasim
am 24 Jun. 2019
0 Stimmen
what about .mlx files ?
Kategorien
Mehr zu Programming finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!