prefdir

Directory containing preferences, history, and layout files

Syntax

prefdir
d = prefdir
d = prefdir(1)

Description

prefdir returns the directory that contains

The directory might be in a hidden folder, for example, myname/.matlab/R2008a. How to access hidden folders depends on your platform:

d = prefdir assigns to d the name of the directory containing preferences and related files.

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

Remarks

The preferences directory MATLAB uses depends on the release. The preference directory naming and preference migration practice used from R13 through R14SP2 was changed starting in R14SP3 to address backwards compatibility problems. The differences are relevant primarily if you run multiple versions of MATLAB, and especially if one version is prior to R14SP3:

Examples

Run

prefdir

MATLAB returns

ans =

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

Running dir for the directory shows these files and others for MathWorks™ products:

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

In MATLAB, run cd(prefdir) to change to that directory.

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

See Also

preferences, winopen

Fonts, Colors, and Other Preferences in the MATLAB Desktop Tools and Development Environment documentation

  


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