Editor's Note: Popular File 2018
This file was selected as MATLAB Central Pick of the Week
Writes a Windows registry file that fixes problems with MATLAB file associations in Windows, e.g., that m-files doesn't open up in MATLAB or opens up in a new instance. Can also be used to switch file associations between different installed versions of MATLAB. Detailed help is included in the file. Has been tested on Windows 7 for MATLAB R2012a and R2015a and on Windows 10 for MATLAB R2020a.
Also included is a program to add missing MATLAB shortcuts to the Windows desktop and start menu and a small Windows batch file to start MATLAB (for example if the installer fails to add shortcuts). Have been tested on Windows 10 for MATLAB R2020a.
Patrik Forssén (2021). MATLAB File Association & Shortcut Fix (https://www.mathworks.com/matlabcentral/fileexchange/51165-matlab-file-association-shortcut-fix), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
Thank you! It works.
Thank you! Worked as described
Thank you very much!
It works very well for MATLAB R2020b
@Panida Kaewniam
The first parameter should be '-add' (not 'add'), i.e, use the following call:
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'});
It doesn't work for me. I have an error when execute the associate file in the command window.
I use
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]});
The error is
Error using associateFiles (line 180)
The action to perform must be a string '-add', '-delete' or '-deleteadd'!
What should I do?
It worked well for me with MATLAB2020a.
Worked for me on (Windows7 Operating system, 2019b Matlab version)
1) Run .m file in matlab, MatlabFileAssocFix.reg is created.
2) Open command window in Windows
3) Run "MatlabFileAssocFix.reg"
4) Restart MATLAB.
Now when try to open .slx file system automatically suggests MATLAB as an option.
Thanks a lot.
Finally after a lot of struggle, I managed to associate .m files to Matlab using your code and then running the .reg generated file with your code.
Thank you
It works great with MATLAB R2020b
it can work, and works very well.
@James Rex
Support for .prj files (+ some additional toolbox specific files) added in version 2.1.
I repeat request from Michael B to add support of .prj files.
These still open with R2017a after I installed R2020b, and the "Open With" tools for modifying file association in Windows 10 File Explorer do not work in this case.
Hi, thanks for the code. It didn't work for me at the beginning. After running the files, my matlab cannot work normally. Error is "loadlibrary failed with error 87 the parameter is incorrect". I am using Win 10, and Matlab version is R2020a. Problem persists after restart.
Then I found the solution from here: https://www.mathworks.com/matlabcentral/answers/183082-plot-loadlibrary-failed-with-error-87
@Seungchoun Choi
Strange... Try to run associateFiles('deleteadd'), import the created registry file, restart the computer and see if this fixes the problem.
If not start the registry editor (Windows start menu -> Run... -> regedit) and locate the folder "Computer\HKEY_CLASSES_ROOT\MATLAB.mlx<version>". The first key there should now have data "MATLAB Live Script" if the fix worked.
it seems like something is messed up when you updated the code last week. .mlx file shows as Matlab toolbox and .mtlbx file shows as Matlab app.
You literally saved me, thanks
I'm using R2020a. It's very good.
Hi,
Any chance you could add support to .prj files? I'm running version R2019b on Win10 and have recently been having association issues with this file type on my system.
Cheers.
I'm using R2019b. It is generating the MatlabFileAssocFix.Reg file but unable to run it. Getting the error "Cannot import C:\......: Error accessing the registry.". Any help on this highly appreciated.
Add the following
'mlx' , 'MATLAB Live Script' , '-71' , ...
{'Open', 'uiopen(''%1'',1)'} , {'Run', 'run(''%1'')'} ; ...
to "fileExtCell" will fix the association for "*.mlx". Not sure whether '-71' is correct or not, just simply choose a number that different from others. It works for me with Matlab 2019b. There is no ico file for *.mlx by default, which need to be added to C:\Program Files\Polyspace\R2019b\bin\win64 and named as mlx.ico. I sample copy the one for *.m files. Don't forget to replace the version and the path with the installed one.
Hello Sir,
I am unable to Associate my matlab files with new MATLAB 2020a in MacOS Catalina. Is there any such Fix? or How to do that association? please let me know.
Thank You.
Only a minor foible though, it does not support '.mexa64', or '.mexmaci64' . But it is not important, I think.
Excellent! It works on my MATLAB2020a on Windows 7! Thanks!!!
It's not working for .mlapp extension. Here's the registry Entry:
___________________________________________________
[HKEY_CLASSES_ROOT\.mlapp]
@="MATLAB.mlapp.9.8.0"
[HKEY_CLASSES_ROOT\.mlapp\OpenWithProgids]
"MATLAB.mlapp.9.8.0"=""
[HKEY_CLASSES_ROOT\.mlapp\Versions\MATLAB.mlapp.9.8.0]
"FileVersionMS"=dword:00090008
"FileVersionLS"=dword:00000000
[HKEY_CLASSES_ROOT\MATLAB.mlapp.9.8.0]
@="MATLAB Application"
[HKEY_CLASSES_ROOT\MATLAB.mlapp.9.8.0\DefaultIcon]
@="C:\\Program Files\\Polyspace\\R2020a\\bin\\win64\\mlapp.ico,0"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mlapp\OpenWithProgids]
"MATLAB.mlapp.9.8.0"=hex(0):
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mlapp\OpenWithList]
_______________________________________________________________________________________________
I don't know how to fix this but probably this entry is different than others that are working. The missing entries are:
1. Shell Open
2. Shell Open command
3. Shell Open ddeexec
4. Shell Open ddeexec application
5. Shell Open ddeexec topic
6. Also, in fileExts location, 'Open With List' for .mlapp is missing; and that's why when I double click file, no application list shows. While it pops up for other extensions.
I solved the problem I was facing regarding the registry file. This file also fixed a problem with Write permission in a code that had to write fig to a gif file.
Note: The registry file gets created in the, 'matlab root folder' > 'subfolder that contains matlab.exe'. It is better not to run matlab.exe as an administrator.
Thanks a lot @Patrik Forssén
The registry file is not getting created in the same folder. Does it get created somewhere else or should there be some other reason for which the registry file is not getting created?
hi
I have installed two versions of matlab, i.e. 2013b and 2020a. But I have a problem, it is that the 2020a version manages to launch correctly, on the other hand that of 2020a does not manage to launch.
Please help me.
I don't know why mine is not working, it shows up with the error:
associateFiles
Unrecognized function or variable 'binFolder'.
Error in associateFiles (line 96)
binPath = fullfile(matlabroot, 'bin', binFolder);
Thank you! This worked with Matlab 2020a.
Oh, sorry about that. It's working now. thanks
Thanks very much! That's works in Matlab 2018!
It works! I recommend using the 'deleteadd' option, in case you messed anything up already. Also, don't forget to restart explorer after running the registry, or just reboot your pc.
Thanks so much!!!
Working perfect.
Thank you.
It's working so fine, thanks
purfectt.
1. run .mfile
2. run the created .reg file
3. restart matlab
done
Tried on Windows 10 19041.84 for 2019b. Everything's fixed! Thanks!
I tried it on my MAC for 2016b, but it did not work. Is there a solution for MAC?
Thank you!
Worded on Windows 10 and fixed .m files opening as separate instance. Run as admin and import the registry.
Hi,
can you add the live-script data format?
Great!!! Works perfectly on MATLAB 2019b win10.
Usefull file exchange
Great!!! Works perfect on MATLAB 2019b
Saved me much time, thank you :)
Thanks!
It worked with my MATLAB R2013a on Windows 10 x64.
When you run .m file in Matlab, it will create a registry file in the same folder with .m file.
Works like magic!
Works perfectly on Matlab 2019b on windows7
Thank you!
Great, it solved my problem very well.
This was easy to use and fixed my issue instantly!
Works perfectly on Matlab 2019b on windows10
Worked on Matlab 2019b. Thanks.
Works successfully with R2019b on Windows 10
Works with R2018a on windows 10.
Works with r2019a! Great! Thanks!
Works with r2019b! Great! Thanks!
Perfect!. Thank you so much. r2018a
WOW!! It's like a magic! Thanks!
Work perfectly with matlab 2019a!!
Works perfectly on Matlab R2017a!
This worked!
Just in case this might be useful for someone else: my network blocked the registry file from running on my non-admin account (and right-clicking the .reg file didn't yield a "Run as Admin" option), so I had to open a command prompt as admin and execute "Regedit MatlabFileAssocFix.reg" to update the registry files. That proved successful though.
excelent
Works perfectly with matlab 2018a on windows 10
Many thanks, worked fine on Matlab 2019a on Windows 10.
It worked for me. I was having .m files openedd at Notepad and .mat files oppend at Microsoft Access ! Now both format files are being opened at Matlab, in a single instance. I use Matlab 2018a, Windows 10. Thank you for the developer.
worked perfectly (Win 10, R2019a), many thanks!
Struggled to set new version of Matlab as default program to open Matlab files and then found this thread. Very useful script!
how to associate .mlx (live editor file)?
fixed problem for my win10 2017b
I love you !!!! It fixed all the hassles of opening multiple instances at every double-clicking of .m files!!!!!
fixed my problem with 2018b
it works well for my 2019a.
Fixed my problem with r2019a. Thanks for making that solution so simple!
Works good. Tried on MATLAB 2018a with Windows 10. Solved annoying issue : clicking on .fig or .m or .mat file, a new Matlab instance was opened. After running function, close all Matlab instances, and click on generated Registration entries file, restart Matlab
But it still opens the whole Matlab session, even if I just want to open the Matlab figure file. How to solve that?
It works like a charm!
Finally I can open files from folders without starting a new session of Matlab.
It worked for 2019a.
Worked on Matlab 2016a. Thank you very much!
Thanks a lot for your effort , it worked on 2018b version win 7 64 bit
I uninstalled R2018b after installing 2019a on Windows 10, then it always opens up a new MATLAB instance when double-clicking on .m files.
This file fixed the problem perfectly!
Thank you so much!
Read the instructions and it will work perfectly.
Thank you so much! It helped for Windows 10, MATLAB R2019a
It works, thank you very much!
Thank you so much! (Windows 7 2017b)
thank you, it works perfectly!
thank you very much!! this is very helpful!!
Thank you very much! Great Work!
Worked like a charm!
This code solved the same problem. Thank you for your sharing.
It worked perfect!
Works on R2017b Windows 10
Thank you!
My problem is that m.files, .slx files etc. keep on defaulting to Adobe... so, tiles in this download shows as a PDF and does not work.
Thank you!
Work like magic!
Worked great for me for Matlab 2018b in Windows 10.
Steps:
1) Run the Matlab File to create the registry file
2) Run the created registry file
Simple, fast and perfect (Windows10, 2018b). Thanks!
It didn't work for me
doenst work
nesta3ref bik
Fixed file association problem with windows 10 and R2018b
I was facing with defined problems in above. Simple to use and works perfectly!
perfect....
Worked like a charm. For people having errors showing that "Cannot write registry file". Restart MATLAB and run as administrator. Follow the instructions in the file and done!
Works Fine with R2018 Thanks
perfect with R2018b. Spent hours to figure out how to associate, before finding this
Worked perfectly with R2018b on Windows 10 Pro! Thanks!
Thumbs up! Woks perfectly for 2018a.
Works perfect. Do not forget to run your MATLAB as administrator
can someone give me the steps. i use MATLAB 2018b with windows 10
Worked with Matlab R2017b.
All right! (R2018a)
Maybe you can fix '.mlx' too! :D (file extension of Matlab Live Script)
Worked perfectly with R2018b on Windows 10 Pro!
thanks
worked great windows 10 matlab 2018b
Thank you very much! Works great
Great! (2018a)
Failed to create registry file.
Perfect!!
This worked beautifully for 2018b. Thank you 8D
Worked perfectly for 2018b! Thanks!
Worked for 2017b. Thanks!!!
Worked for 2018a Win10, many thanks!
It worked very well on MATLAB 2018a win10.
I accidentally associated my .m files to Matlab.exe, which then started opening Matlab every time. This file helped fix that problem by updating the registry directly just by simply running the function and running the .reg file that is created. Thank you Patrik for making this!
saved my life.
work for MATLAB R2015a in Windows 10.
Thank you Mr! Hats off to you!
Worked perfectly on MATLAB R2018a
It works for 2018b :) !!
doesn't work on 2018b
One of the best functions that I've used in matlab. Works for 2016a on win10.
Wow. Thank you.
I had updated my Matlab version and the registry would not find 2018a version. This was done on a Windows 7 64bit. As soon as I ran the registryfix file everything worked again.
Again, Thank you
Working on win 64bit Matlab 2017b. Thanks to you!
Works on my win10 64bit + Matlab 2018, many thanks!
work just fine on windows 10 thank you !
Thank you very much! Works like a charm with Matlab 2018a on Windows 7
Thank you very much! It works for Matlab R2017a on Windows 10.
Works for Matlab R2015b on Windows 10
Doesn't work for R2017b for Windows 10.
Works on Windows 10 for MATLAB R2017a
Works for 2018a on windows 7.
Working on 2017b
working on windows 10 MATLAB 2016a
Thanks a lot! it works with MATLAb 2016a/win 10-64.
Perfect! Works for Windows 10, Matlab R2018a. Thank you!
Works! Win 7 Matlab2017b.
Thanks a lot!
Working, Windows 10 R2018a Update 2
excellent and very convenient!
excellent work by the author - now please add live code MLX File (.mlx) files to your program
Solved my problem! Thank you so much!!
It solves the problem. Thank you very much!
Is there a version for Linux? I have the problem "opens up in a new instance"
Working for R2018a, thank you!
Thank you, worked perfectly on R2018a, Windows 10
Why can this not be done through MatLab preferences... shame shame MathWorks.
Thank you!! this works perfectly
Worked perfectly for 2018a
Didn't work for me. 2018a.
Perfect! It works. Matlab R2018a on Windows 7.
It works. Thanks.
Works! Don't forget to run Matlab as administrator, though.
perfect...tnx
Works. Matlab R2018a on 64-bit Windows 10
Worked perfectly on win10 with matlab 2017b
Works for my R2018a on Windows 10 platform!!! Feel like the messy world has been saved!!! Thank you, MATLABman!
made my day :-)
Works good!
Thank you sooooo much, microsoft is really getting on my nerves with their forced updates that screw up everything. Thanks for the fix
Nice. It worked fine for Matlab 2018a in windows 10
Works on 2018a...But doesn't associate .mlx
Indeed, works for Matlab R2018a ... Brilliant!
Perfectly work also on Matlab R2018a
I can't believe how bad Microsoft has messed up the Windows 10 interface for assigning default programs based on file extension. Utterly pathetic. I couldn't find any way to release .mat files from Access and remap to MATLAB no matter what I did.
Your tool provided the perfect fix. Thank you so much!
Do you have a version of this for Mac computers?
It works perfectly with Matlab R2017a!
Worked for me, thank you!
Works perfectly on MATLAB R2016a on windows 10, Thank you so much.
Works for 2015b
Amazing!
It worked on Matlab 2017b
Now I can't access any files from my computer in matlab. How do i fix that.
works on Windows 10. Thank you !
Had a tricky situation with MATLAB installed on a shared drive for which I didn't have writing rights and each time I double clicked a matlab file it opened in a new instance.
This solved it as a charm! AMAZING!
Very nice program! Fixed my problem in 3 minutes :)
Worked perfectly, thank you!
AWESOME
Great job
worked for 2016b, good
wow it worked for 2017a
superb! working perfectly. Thanks a lot
Thanks very much! It's necessary to run matlab as admin.And remember reboot,then okay!
Thank you very much. It worked for 2016a.
2017b working, thanks
same steps as said before
NOTE: Turn off anti-virus and UAC
1) Run Matlab as admin
2) put associateFiles.m in ....matlab folder ....mcr\toolbox\matlab\winfun\private
3)open and execute associateFiles.m
4) Execute the command (in matlab command window)
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]});
5) You will get regfile MatlabFileAssocFix.reg, run it
2017b working, thanks
same steps as said before
1) Run Matlab as admin
2) put associateFiles.m in ....matlab folder ....mcr\toolbox\matlab\winfun\private
3)open and execute associateFiles.m
4) Execute the command (in matlab command window)
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]});
5) You will get regfile MatlabFileAssocFix.reg, run it
This function works , but i would like to know more, in line 100, what does the variable 'fileExtCell' mean,
specially its columns 3-5, in order to add latest extensions. For example, I added one row more
{'mlx', 'MATLAB Live Script', [], [], []},
but files with this extension are not shown with the appropriate icon and can't be opened outside Matlab.
Works perfectly, thanks
This works great. I also added ".sbproj" as an extra argument [ associateFiles('add','.sbproj') ] to allow Windows to automatically open SimBiology projects as well.
Thanks a lot.It works.How do I associate .mlx file? Windows10+R2017b
Awesome.
2017b working!
Thanks, this problem has troubled me since the version of 2014a, the registry file worked on 2017b!
THANKS ALL GOOD
It used to work until the Fall Creators Update i.e., Windows 10 ver 1709 build 16299.15, comes in and screwed everything up with their UWP default program association.
The current only way to work around this is that you HAVE to START MATLAB by opening a .m file. Only then all subsequent .m files will be opened in the same MATLAB instance.
I really hope that this script gets an update to fix this.
Thanks a lot.It works.How do I associate .mlx file? Windows10+R2017b
Thanks a lot. It works perfectly! Windows 10 and matlab 2017b!!
THANK YOU THANK YOU! This is a really great tool!!!!!!!! So GRATEFUL! (R2017a) It works well!
I upgraded from 2015b to 2017b today, and after the upgrade I couldn't dobule click open my m.-files. Downloading the script to my desktop and following the instructions of Muhammed Hafish solved the problem. Thanks!
Thank you thank you thank you! I tried all the official problem solving ideas provided by "MATLAB answers" but none worked, but this solution did! (Matlab 2017b + Win 7)
You saved my day...
Good job! (Matlab 2017b + Win 8.1)
it works for R2016a, thank you
for those who still struggled with this problem, thanks to Yannis Gr, here what i did
1) Run Matlab as admin
2) Open and execute associateFiles.m
2) Execute the command (in matlab command window)
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]});
3) You will get regfile MatlabFileAssocFix.reg, run it
4) Restart pc or kill explorer.exe and run it again
5) Finish
It works for 2016a! Thanks
It does work for MATLAB R2017b, but Windows 10 1709 RTM 16299.15 (Fall Creators Update) HAS A F***ING BUG (AS ALWAYS) with the File Association and the Settings UWP....
It does Not work for MATLAB R2017b, Windows 10 1709 RTM 16299.15 (Fall Creators Update)
Works on R2017b
It works! @ Windows 10/ 2015a
1) Execute the included file(associateFiles.m)
2) New registry file(.reg) is generated, [MatlabFileAssocFix.reg], where the above m file is located.
3) Execute the registry file
4) Restart the PC
Thank you very much. It worked. You saved my day. Following these instructions from Yannis Gr:
"A bit more help on how you should do this.
1)Download the file
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.
%% 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]});"
Worked on R2017a. Better than any MATLAB Answers. Thumbs up!
Worked with R2015a on Windows 10, though you have to confirm .m-files to be open with MATLAB (the typical Windows popup)
It works! Excellent!
Thank you!
Worked on Matlab R2017b. Thank you. Following these instructions from Yannis Gr:
"A bit more help on how you should do this.
1)Download the file
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.
%% 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]});"
Worked on Matlab R2017b. Thank you.
how it works in matlab 2016b on win7?
Thank You!!!
Works on R2017a with the caveat that .mlx files (MATLAB Live Scripts) are supported. As stated, was tested on R2012a and R2015a so to be expected.
Excellent on 2016b
Your file solved the problem that bothered me for a long time. Thanks a lot.
Works like a charm. Thank you so much!
Thank you so much dude! It works perfect on win 10 x64 R2015b!
GJ! Works on Win 7 x64 R2016b! Thanks!!!
Works on 2017a here. Running MATLAB as Admin (win10) does the trick. To get the matlab icons to show up, right-click on one of the newly associated files (.m or whatever) go to Properties. Click "Change" next to Opens With and select the MATLAB 201x* option which be at the top of the list (and have "New" next to it). Do that even if MATLAB 201x* alreadyappears next to Opens With.
*x denotes your version of MATLAB.
Works like a charm!, great work!
Thanks a lot Patrik. You are champ!
Excellent.
Works on r2015a thank you! How can we shows the default icon for the files?
Good, it works on r2017a. However, .m files do not shows the default icon of MATLAB.
Worked like a charm! Thank you Patrik!
Worked on MATLAB R2017a
Answer by Yannis Gr. on 16 Jun 2016
Edited by Yannis Gr. on 16 Jun 2016
A bit more help on how you should do this.
1)Download the file
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.
%% 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]});
Worked on Win10 R2016a. Thanks.
Didn't work on Matlab R2017a
It works perfectly in Matlab R2015b in Windows Server 2016! Thanks!
Works amazingly well Thank You! r2016a windows 8.1 x64
good job
works for r2016b windows 7
Works like a charm! r2015a, Windows 10 64 bits.
Thanks! It works in Matlab R2016a in Windows 10!
Works for R2016b! Thanks a lot !
It works perfectly in Matlab R2016b in Windows 10! Thanks!
Perfect
Great work. Perfect for R2015a.
perfect for R2016b
works perfect on MatLab 2016a in Win7!
Perfect! Thanks!
It works on MatLab 2016a. it saved my time. Thank you.
It works, one line sublime fix.
Excellent! It solved my issue!
Super Effective!!!
the File is good. but the method given by karim baa is the best
thank you very much,
i tried it with 2015a
Perfect works on 2016b\win10, just follw all the steps : 1)Run "associateFiles.m.", 2) Exit matlab, 3) double click generated "MatlabFileAssocFix.reg", 4) restart pc.
Excellent!! Perfect!!
Thank you very much!!
perfect!
Thanks a lot. I was about too reinstall Matlab just to fix this stupid file association. But this saves me a lot of time and efforts. I can' thank you enough.
great! works well @ win7 2016a
Nice job
NICE PLAY
GOOD
Thanks Patrik
It's nicely work for me
Wish that .mlx file would be associated.
maybe my matlab was bad T.T , It's not working. still thank you .
Works!
thank you so much, worked perfectly
perfectly figure it out, fatastic!!!thank you so much! matlab2016b,win10
Works perfectly for R2013a on Windows 8.1. Nice job! Thanks.
Works for R2016b, windows7.
Solved my problem. Thanks Mathworks
how to associate live scripts "*.mlx" files please?
It worked!!
Thank you so much!
Thanks! Helped as accepted 2015a
Thanks, but it doesn't seem to work on 2016b(Win10 x64 1067)
Thanks!
thanks.
Doesn't seem to work with R2016b on Win10
Nice Job. Thanks for making it so easy.
Thanks!!!
worked for MATLAB 2016a, thanx very much.:)
Works perfect with R2016b. If the .reg file won't work, just copy it into another folder and start it.
Thanks !!
2016a - Windows 10, Worked. Nice!
This doesn't work for 2016b. Can you help me with this?
Excellent work! Thanks!
Perfect
Thank you. It worked on Matlab 2016a on Windows 10 Pro.
Worked!
thanks bro!! It worked on Matlab 2015b on windows 7
It works very well for me! Thanks a lot!
Excellent! Thanks very much!
Thanks very much!
Fixed my problem of a new MatLab session being started every time I open a m file. Life Saver!
Worked on Matlab R2016a on Windows 10 64bit
slx files is not associated
Thanks very much!
It work for Matlab r2016a on Windows 10 (1607).
works win 7 R2016a
Works perfectly for R2016a. Thank you Patrik Forssén.
Great submission! Still works 2015b (student) Win10x64.
Thanks a lot!
works great but it left all my .fig .m icons blank white.
Thank you! This is much better than re-installing R2016a. Curiously, it removed R2012b from my open-with menu but R2014a, R2014b, R2015aSP1 and R2015b are still there.
It's working for me(R2016a) but you have to run the created 'MatlabFileAssocFix.reg' file outside matlab manually.
Great job thank you
Thanks a lot! A much needed fix!
Excellent!! it works very well (Matlab 2015b - Windows 10)
Fantastic.It works well on windows 10 for matlab 2016a. Thank you!!
Fantastic.It works well on windows 10 for matlab 2016a. Thank you!!
Amazing! windows10 and Matlab2016a, it works!
WOW thanks so much buddy!! Works with R2016a in Windows 10.
Thank you!! Worked perfectly!
Absolutely Brilliant! Solved the problem...
how can I download it?
works with MATLAB 2016a, Windows 10 X64
Absolutely brilliant! You may want to consider having this allow multiple versions of MATLAB as you can no longer choose older versions for the Default afterwards without of course deleting the current default. It would be nice to be able to do this in Windows still afterwards.
Thanks! Problem solved.
man, you are amazing.
It's work with me and it is fantastic.
Brilliant!!!
I can't even count how many hours over the years I've been frustrated by this silly problem, and all the failed suggestions in various forums, including mathworks. Thanks for this submit, A+++
hi, not work on my Matlab version
Gracias =D !!
Funciona perfectamente
Matlab 2015a | win 10
OJO: Si crees que no funciona, solo hay que leer las instrucciones que están dentro del archivo .m
Saludos
Thanks!!! Worked perfectly!!!
Matlab 2015a and Windows 10
Muchas Gracias!!! Funciono a la perfección Matlab 2015b
please help, new to matlab , how do i add this file to matlab path so that it correct the file association issue, thanks
Unbelievable. Amazing.!!! It works even with 2015b. I screwed up my pc before use this script but it fixed all the bugs. Thanksxx
thanks man, cakewalk. Can't believe windows doesn't do this automatically, mac has no issues
worked well
wow okay, I commend you for this - most of lifelong problems now solved :D
Thank you for the solution. It work very well
I am really disappointed that this didn't work either. I am using R2014b and associated file is still the Starter Application, and clicking the .m file right now only opens a new instance MATLAB, not even a new instance of MATLAB with its editor open with the file. I'd be happy to hear any suggestion anyone gives.
Tried many things for R2015a and this one worked perfectly, thanks
Worked perfectly. Had tried a lot of different proposed solutions in the past but this is the only one that actually worked (2015a). You saved me a lot of headaches :) Thanks!
worked perfectly