MATLAB Function Reference | ![]() ![]() |
Return directory containing preferences, history, and .ini
files
Syntax
Description
prefdir
returns the directory that contains preferences for MATLAB and related products (matlab.prf
), the command history (history.m
), and the MATLAB initialization file (MATLAB.ini
).
d = prefdir
returns the name of the directory containing preferences and related files, but does not ensure its existence.
d = prefdir(
creates a directory for preferences and related files if one does not exist.1
)
Examples
Running dir
for the directory shows
dir . cwdhistory.m matlab_help.hst .. history.m MATLAB.ini launchpad_cache.txt cstprefs.mat matlab.prf
See Also
Setting Preferences" in the MATLAB Development Environment documentation
![]() | ppval | primes | ![]() |