How do I import my MATLAB path preferences when I install a new version of MATLAB?
18 views (last 30 days)
Show older comments
MathWorks Support Team
on 10 May 2011
Commented: K E
on 17 Sep 2014
I would like to port all my preferences from one MATLAB version to another. I want to port over the path preferences to the new version of MATLAB which is not part of the standard preferences directory.
Accepted Answer
MathWorks Support Team
on 20 May 2015
A new version of MATLAB ports over most user preferences if there is an older release of MATLAB on the system. However, this is a limitation where the user defined paths are not carried over from one release to another.
You can manually transfer the path information. All of the MATLAB Path information is saved in the PATHDEF.M file. What you can do is save the PATHDEF.M file from your current installation of MATLAB before you uninstall it. We suggest uninstalling MATLAB rather than installing on top of a current installation.
You can locate the PATHDEF.M file by executing the following at the MATLAB command prompt:
which pathdef
After the new version of MATLAB is installed:
1. Open the old PATHDEF.M file and the new PATHDEF.M file.
2. Copy and paste all of the directories you wish to keep on the MATLAB Path from the old PATHDEF.M file into the new PATHDEF.M file. The new PATHDEF.M file should already have the MATLAB and Toolbox directories listed, so you should only have to add your personal directories.
3. Save the PATHDEF.M file.
4. Restart MATLAB and run the PATHDEF command.
5. Run the PATH command to make sure the path was set up properly.
Troubleshooting:
Create a PATHDEF.m that includes all installed toolboxes by executing the following code at the command prompt:
restoredefaultpath
savepath
Then perform steps 1 through 5 to add your personal directories.
1 Comment
K E
on 17 Sep 2014
This is a lifesaver. But why not automate it, i.e. look for the last pathdef.m file, extract all the non-Matlab user-defined directories, and copy them to the new pathdef.m? It would greatly increase the convenience of Matlab updates.
More Answers (0)
See Also
See Also
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!