Add folders to search path
addpath(folderName1,...,folderNameN)
addpath(folderName1,...,folderNameN,position)
addpath(___,'-frozen')
oldpath = addpath(___)
addpath(
adds the specified folders to the top of the search path for the current MATLAB® session.folderName1,...,folderNameN
)
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.
To save the newly modified search path for future MATLAB sessions,
use the savepath
function. Alternatively,
use addpath
statements in a startup.m
file
to modify the search path programmatically at startup.
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.