Desktop Tools and Development Environment |
Viewing the Search Path
The MATLAB search path field in the Set Path dialog box lists all of the directories on the search path. The top of the list is the start of the search path, while the bottom of the list is the end.
Function Alternative. Use the path
function to view the search path.
Adding Directories to the Search Path
Add directories to the search path when you want to run M-files in those directories.
To add directories to the MATLAB search path using the Set Path dialog box,
You cannot add method directories (directories that start with @) and private directories to the MATLAB search path.
Adding Directories to the Path from the Current Directory Browser. In the Current Directory browser, select a directory, right-click, and select Add to Path from the context menu. Then select one of the submenus, for example, Selected Folder and Subfolders.
Function Alternative. To add directories to the top or the end of 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
statements in your startup
M-file to automatically modify the path when MATLAB starts. For details, see Modifying the Path in a startup.m File.
Viewing and Setting the Search Path | Moving Directories Within the Search Path |
© 1994-2005 The MathWorks, Inc.