addpath
Add folders to search path
Syntax
Description
addpath(
adds the
specified folders to the top of the search path for the current MATLAB® session. folderName1,...,folderNameN
)
If the input is a set of multiple folders separated by path separators, then each of the specified folders will be added.
addpath(
adds
the specified folders to the top or bottom of the search path, as
specified by folderName1,...,folderNameN
,position
)position
.
addpath(___,'-frozen')
additionally disables
folder change detection for the folders being added. When folder change
detection is disabled for a folder, MATLAB does not detect changes made to the folder from outside of
MATLAB.
Use this syntax with any of the arguments in previous syntaxes. You can
specify '-frozen'
and position
in either
order.
Examples
Input Arguments
Output Arguments
Tips
To save the newly modified search path for future MATLAB sessions, use the
savepath
function.To modify the search path programmatically at startup, use
addpath
statements in astartup.m
file. For more information, see Add Folders to the MATLAB Search Path at Startup.
Algorithms
If you use addpath
within a local function, the path change
persists after program control returns from the function. That is, the scope of the path
change is global.
Version History
Introduced before R2006a