MATLAB Answers

How do I copy all my shortcut buttons to another installation of MATLAB?

35 views (last 30 days)
I want to copy all my shortcut buttons to a MATLAB installation on a different machine (or to a different MATLAB version on the same machine). Is there a file which contains all the shortcuts definitions that I can copy and paste into the directory of another installation?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 6 Apr 2020
Edited: MathWorks Support Team on 6 Apr 2020
There is a XML file that contains all the shortcut definitions. This file is called 'shortcuts.xml' (R2012a and earlier) or 'shortcuts_2.xml' (R2012b and later). It is located in the MATLAB preferences directory. The location of this directory can be determined by entering the following command in the MATLAB command prompt:
>> prefdir
On a Windows operating system you can directly open the preferences directory by typing the following at the MATLAB command prompt:
>> winopen(prefdir);
Copy the following XML-files into the preferences directory of another MATLAB installation: # MATLABDesktop.xml # MATLABQuickAccess.xml # favorite_commands_toolset_favorite_commands_gallery.xml # FavoriteCommands.xml # shortcuts_2.xml
This will create all the shortcuts defined in this file in that particular installation. If you are copying these shortcuts from a pre-R2012b version of MATLAB to R2012b or later, rename the file from 'shortcuts.xml' to shortcuts_2.xml'.
  1 Comment
Marius Mueller
Marius Mueller on 5 Jul 2017
I used the method above to copy the shortcuts to a second PC but was faced with the issue of the shortcuts not showing up at the quick access toolbar without further actions.
To achieve this one should copy the "MATLABQuickAccess.XML" file in addition to the "shortcuts_2.xml" from the "prefdir" folder.

Sign in to comment.

More Answers (1)

Gokul on 31 Jan 2020
Once you open the folder by using:
I had to copy these four files:

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!