How to migrate all settings, preferences, histories, layouts, ... _everything_ user related from 2013a to 2014a?
조회 수: 47 (최근 30일)
이전 댓글 표시
I spent significant time and effort to get the user interface for v2013a set up exactly the way I wanted it. Plus, my use of matlab is ongoing. What I was doing yesterday using 2013a, I want to continue today using 2014a.
A migration of all user-related info ought to be about the first thing that matlab does when upgrading between versions. But it does not. Therefore there ought to be something inthe installation manual, or at least a README file that explains how to make the yearly transition seamless. If there is something there, I cannot not find it.
According such documentation as I could find, all one has to do is delete the 2014a prefs folder,
C:\Users\<user name>\AppData\Roaming\MathWorks\MATLAB\R2014a
and matlab will automatically recreate it and migrate everything from
C:\Users\<user name>\AppData\Roaming\MathWorks\MATLAB\R2013a
to the new version.
Well, of course it does not. I've tried manually copying the contents of the 2013a folder to the 2014a folder, but that results in a huge spewing of java errors on the command window when I attempt to open the history window. It appears that nothing at all is migrated.
So, how do I do migrate ALL my settings, histories, layouts, paths, etc. from one version to the next?
댓글 수: 0
채택된 답변
Namita Vishnubhotla
2014년 7월 22일
MATLAB preferences will get automatically migrated to new installations, but user-defined preferences will not.
To manually migrate user-defined preferences to a new installation, use the following procedure:
1) In the older installation, execute the command,
>> prefdir
2) Look in the directory from step 1 to find a file called 'matlabprefs.mat'.
3) In the newer installation, execute the command,
>> prefdir
4) Copy the file from step 2 into the directory from step 3.
Note that this will erase any user-defined preferences in the newer installation.
댓글 수: 5
Peter Cervelli
2019년 10월 7일
Please answer Eric's question from October 6, 2019 -- I'm suffering from the same issue. I spent a lot of time setting preferences so that they're exactly the way I want them, and it's very frustrating to fire up the latest version of Matlab only to find that they've been completely ignored. I've been using Matlab more or less continuously since 1996, and I manage a group of users comprising more than 30 licenses so a quick answer to Eric's question is pretty important to me.
Thanks.
Will Reeves
2022년 9월 7일
Seriously? How is this an "accepted answer"? Why isn't the answer to this question:
"Yes, sorry for the inconvience we will of course put a check box in the next Matlab installer that will give you the option of copying all your preferences (including java path definitions files) to the new installation"?
I've had/chosen to do this twice a year for over a decade and it's really irratating and unnescessary. And yes, I have submitted a feature request on this topic...
추가 답변 (4개)
Jude Sauve
2020년 6월 2일
The case, as documented, for me was when upgrading by more than 3 half versions, it wouldn't auto update. For me, upgrading from 2018a to 2020a (Three half versions before 2020a was 2018b).
Under C:/Users/<User>/AppData/Roaming/MathWorks/MATLAB/, I found it sufficient to (while all matlabs closed) delete the directory corresponding to my new version, ex 2020a, then rename the dir with my preferences to the oldest "supported" version. Ex rename/F2 the 2018a/ dir to 2018b/. Then on opening the new version of matlab (2020a) it did grab the old preferences from that directory. Then close new matlab (2020a) and change the name of the directory back. (If you don't just delete already).
댓글 수: 3
Alan Peters
2019년 10월 7일
댓글 수: 6
Bruce Stirling
2020년 2월 19일
Given the number of steps you'd think Mathworks would build a routine. And migrating to a new PC platform requires the same thing. Maybe a routine that puts all these files in a .zip and then you can copy that one over and unzip would be a good solution.
Sanjay Manohar
2020년 9월 15일
@Peter, the directory /RnewV means "R" followed by the new-version number, e.g. "/R2020a"
James Brown
2020년 12월 8일
Migrate preferances from a previous version
Run the old MATLAB version and find the preferance folder
OldFolder = prefdir % run in old version
Run the new MATLAB version and find the preferance folder
NewFolder = prefdir % run in new version
Exit matlab, then zip all the files in NewFolder in case something goes wrong
Copy all the files & folders from OldFolder to NewFolder (overwrite existing files!)
Restart matlab
As of migrate to 2020b, everything seems to migrate
I'm using "Home" version, but I'm thinking they'll all work this way except possibly network instalations
댓글 수: 1
IGNACIO
2023년 2월 9일
I have built a simple application for launching Matlab that can not only migrate preferences, but also have saved preferences for different projects and allow to start Matlab with the preferences (working directory, history, etc.) for the project you want in each moment. This allows me to easily separate history and other settings per project (by the way, I also think this should be a Matlab menu option).
It's far from a fully finished solution, but I been using it daily for 3 years and works like a charm.
Instead of launching directly Matlab, my Direct Access runs my utility, that requires 3 arguments:
--exe=path to matlab executable
--default=where Matlab stores its default environment
--user=where I whant to have my preferences divided by project
Example:
MatlabLauncherUPP --exe=D:/MATLAB/R2022b/bin/matlab.exe --default=C:/Users/MyUserName/AppData/Roaming/MathWorks/MATLAB/R2022b --user=C:/Users/MyUserName/MyMatlabPreferences
The application (really small) is written in C++ under Qt-Creator, but could be done in any language as at the end if does a quite simple thing:
It maintains a txt file with one entry per project: "name , last date and hour activated, default working directory" and one directory per project that will be the prefdir (where the settings are saved) when selected.
Upon selection of a project, Matlab is started as a new process with the environment variable MATLAB_PREFDIR pointing to the desired directory, and the working directory pointing to the default working directory. The launch part looks like this, even if you don't know C++ and Qt-SDK I think it's easy to understand:
void MainWindow::on_qGoPushButton_clicked()
{
MyProjectsListWidgetItem* selectedProject=GetSelectedProject();
QString env=QString("MATLAB_PREFDIR")+"="+selectedProject->preferencesPath;
selectedProject->lastAccessTime=QDateTime::currentDateTime();
QProcess proc;
proc.setProgram(matlabExe); // matlabExe is a QString parsed from command line option --exe=...
proc.setEnvironment(QProcess::systemEnvironment() << env);
proc.setWorkingDirectory(selectedProject->workingDir);
qint64 pid;
if (proc.startDetached(&pid))
{
SaveProjectsList();
exit(0);
}
}
When launching Matlab, all the changes in the preferences (history, etc.) will be automatically saved in the PREFDIR by Matlab, so they will be used again when the same project is selected in a new session.
For a new project, the utility allows to create a new entry and to copy the initial settings from an existing project.
Using this small utility, apart of the convenience of having something like separate workspaces or sessions, I've just upgraded from Matlab R2016a to R2022b, and only changed the directories in the launcher to have the same configuration I had.
댓글 수: 1
IGNACIO
2023년 2월 9일
I forgot to mention, the editor open files are also one the settings that are saved and recovered per project, so each time I launch Matlab from the utility I automatically have in the editor the .m files that are useful for the specific project, what is also very convenient.
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!