Importing/Exporting Preferences to a new MATLAB installation on a new computer

15 views (last 30 days)
Every time I install MATLAB on a new computer, I have to re-customize it (keyboard shortcuts, docking, etc...). Is there a way to export configuration choices made through the Preferences cog
from a previous MATLAB installation and import it to a new installation on a new computer?
  2 Comments
Matt J
Matt J on 3 Aug 2015
Edited: Matt J on 3 Aug 2015
Are setpref() and getpref() applicable to this, by any chance? I can't tell from their documentation precisely what it is that they do.
Adam
Adam on 3 Aug 2015
prefdir
seems to point to your preferences directory. Can you not just copy that folder to your new computer to apply the same preferences? I assume it doesn't have any machine specific stuff in it, though I may be wrong.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 3 Aug 2015
The preferences are stored in prefdir but hardly any of them are accessed by setpref() and getpref(). I see something for zoom and for profiler in mine.
setpref() and getpref() maintain ~/prefdir/matlabprefs.mat which is a struct named Preferences with one substructure for each "group".
Within prefdir MATLAB stores various settings in different .xml files, and also in matlab.prf which is a plain text file with assignment statements (but not .m code), and also in matlab.settings which is an XML file. There are also some .m files such as history.m (used to store recent history).
So it looks like you would need to copy most of the files from prefdirs .
But as noted in the "What frustrates you about MATLAB" thread, MATLAB might only automatically import and fix-up preferences for the immediately previous version; I do not know if that is the case. The suggested work-around implied there would be to copy your prefdir to one whose name implied it came from the release before you are installing, and hope that the installation picks up the files and updates them.

More Answers (0)

Categories

Find more on Introduction to Installation and Licensing 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!