prefdir - Directory containing preferences, history, and layout files

Syntax

prefdir
d = prefdir
d = prefdir(1)

Description

prefdir returns the directory that contains

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

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

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

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\R2008b

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

Preferences in the MATLAB Desktop Tools and Development Environment documentation

  


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