Development Environment | ![]() ![]() |
Adding Directories to the Search Path
To add directories to the MATLAB search path using the Set Path dialog box:
The selected directory, and subdirectories if specified, are added to the front (top) of the search path. They remain on the search path until you end the current MATLAB session. To use the newly modified search path in subsequent sessions, you need to save the path - see Saving Settings to the Path.
You cannot add method directories (directories that start with @) or private directories to the search path. You cannot access the top level of a UNC pathname.
Function Equivalent. To add directories to the search path, use addpath
. The addpath
function offers an option to get the path as a string and to concatenate multiple strings to form a new path.
You can include addpath
in your startup
M-file to automatically modify the path when MATLAB starts.
![]() | Viewing the Search Path | Moving Directories within the Search Path | ![]() |