Uninstalling old version of Matlab
Show older comments
I have three versions of Matlab on PC: R2017a, R2018b, and R2019b. I want to free up my laptop and delete these unused versions. I have a bunch of files that were created with R2017a. When I open these files they will open up R2017a instead of R2019B (even though I have R2019B on my PC). If I delete R2017a and R2018b from my PC, what will happen to these old files which default-open R2017a ? I ask because I still use those old files regularly for my academic research.
10 Comments
Mohammad Sami
on 1 Apr 2020
Edited: Mohammad Sami
on 1 Apr 2020
As long as none of the functions are not deprecated in newer versions, they will still work.
To test,
Instead of opening files by double clicking, open the desired version of matlab,
navigate to the folder containing the files, and run it from command line.
Luke Megonigal
on 9 Apr 2020
Walter Roberson
on 10 Apr 2020
.m files will usually open with the release that was most recently registered as the file association. When you install MATLAB, it automatically registers that release. So if you were to install R2017a after R2019b, then files might suddenly start opening with R2019b.
The File Association Fix, when run from MATLAB, figures out which release you are using and registers that as the version to be used to open matlab related files.
The version that a file was created in does not come into play in any of this. MATLAB does not keep any version numbers associated with .m files. .m files are plain text files.
MATLAB does keep version numbers associated with .mlx (Live Script) and .mdl (old-style Simulink Models) and .slx (new-style Simulink models), but that does not affect which MATLAB version you get if you double-click the file. The double-click is the file association stuff I mentioned earlier, and goes along with the file extension (e.g., .slx), because File Explorer does not know anything about version numbers. When you open a .mlx or .mdl or .slx in a newer MATLAB release than it was created with, then MATLAB automatically figures out backwards compatibility issues. If you try to open a .mdl or .slx with an older MATLAB release than it was created with, MATLAB refuses. If you try to open a .mlx (Live Script) with an older release than it was created with, then if I understand what people have been posting, MATLAB will try to open it, but it will not always succeed.
Luke Megonigal
on 10 Apr 2020
Walter Roberson
on 10 Apr 2020
No, you will probably need to run File Association Fix.
Luke Megonigal
on 10 Apr 2020
Luke Megonigal
on 10 Apr 2020
Walter Roberson
on 10 Apr 2020
Sounds plausible.
Luke Megonigal
on 12 Apr 2020
Answers (1)
Anurag Agrawal
on 3 Apr 2020
1 vote
M-files will work in the newer version provided functions are not deprecated in newer version.
As mentioned in the comment, you can test the files by opening the files using the desired version of MATLAB.
In order to use Simulink files, you will need to be mindful of which version you are using. You can always open an older file in a newer release (i.e. R2019b will open a R2017a Simulink model), but not the other way around (i.e. R2019b will not open a R2017a Simulink model). To be backwards compatible, you will need to make sure you "export" any work done in R2019b to R2017a by going to File >> Export As >> Previous Version.
You can also have a look at the answer by Vikaasa Kumar about the codeCompatibilityReport:
Documentation for codeCompatibilityReport:
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!