Development Environment    

Adding Directories to the Search Path

To add directories to the MATLAB search path using the Set Path dialog box:

  1. Click the Add Folder or the Add with Subfolders button.
  1. The Browse for Folder dialog box opens.

  1. In the Browse for Folder dialog box, use the view of your file system to select the directory to add, and then click OK.
  1. The selected directory, and subdirectories if specified, are added to the 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 directly to the search path. Instead, add their parent directories.

Adding Directories to the Path from the Current Directory Browser.   In the Current Directory browser, select the directory, right-click, and select Add to Path from the context menu.

Function Alternative.   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