View or change default user work folder
userpath
returns the first folder on the
search path, specified as a character vector. MATLAB® adds the
folder specified by userpath
to the search path
at startup.
userpath(
sets
the first folder on the search path to newpath
)newpath
.
The folder specified using userpath
appears at
the top of the search path immediately, and at startup in future sessions. MATLAB removes
the folder previously specified by userpath
from
the search path.
Note:
By default, the startup folder is the |
userpath('reset')
sets the first folder
on the search path to the default for your platform. The default userpath
folder
is platform-specific.
Windows platforms — %USERPROFILE%/Documents/MATLAB
.
Mac platforms — $home/Documents/MATLAB
.
Linux® platforms — $home/Documents/MATLAB
if $home/Documents
exists.
MATLAB immediately adds the default folder to the top of the search path, and also adds it to the search path at startup in future sessions. On Windows and Mac platforms, the default folder is created if it does not exist. On Linux, the default folder is not created if it does not exist.
userpath('clear')
removes the first folder
from the search path immediately, and for future MATLAB sessions.