Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

prefdir - Folder containing preferences, history, and layout files

Syntax

prefdir
f = prefdir
f = prefdir(1)

Description

prefdir returns the folder that contains

f = prefdir assigns to f the name of the folder containing preferences and related files.

f = prefdir(1) creates a folder for preferences and related files if one does not exist. If the folder does exist, the name is assigned to f.

Remarks

You must have write access to the preferences folder, or MATLAB generates an error in the Command Window when you try to change preferences.

The folder might be a hidden folder, for example, myname/.matlab/R2009a. For more information, see Viewing Hidden Files and Folders.

The preferences folder MATLAB uses and how preferences migrate when you use a new version of MATLAB depend on the version. In R14SP3, there was a change to the way that the preference folders were named and how they migrated, affecting R13 through R14SP2. The differences are relevant if you run multiple versions of MATLAB and one version is prior to R14SP3:

Examples

View the location of the preferences folder:

prefdir

MATLAB returns:

ans =

C:\WINNT\Profiles\my_user_name\MATHWORKS\Application Data\MathWorks\MATLAB\R2009a

Run dir for the folder to see the files for customizing MathWorks products:

.                  history.m          
..                 matlab.prf         
cwdhistory.m       MATLABDesktop.xml
shortcuts.xml      MATLAB EditorDesktop.xml
...

In MATLAB, run cd(prefdir) to make the preferences folder become the current folder.

On Windows platforms, go directly to the preferences folder in Microsoft Windows Explorer by running winopen(prefdir).

See Also

preferences, winopen

Specifying Options for MATLAB Using Preferences in the MATLAB Desktop Tools and Development Environment documentation

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS