|On this page…|
You can interactively add and remove folders, and change the order of folders on the search path, for the current MATLAB® session and for future MATLAB sessions. When files with the same name appear in multiple folders on the search path, MATLAB uses the one found in the folder nearest to the top of the search path.
On the Home tab, in the Environment section, click Set Path. The Set Path dialog box appears.
Use the Set Path dialog box to modify the search path.
To use the newly modified search path only in the current session, click Close.
To reuse the newly modified search path in the current session and future sessions, click Save, and then Close.
To undo your changes, click Revert, and then Close.
To restore the default search path, click Default, and then Close. The default search path contains only folders provided by MathWorks®.
Note: The MATLAB (userpath) folder automatically moves to the top of the search path the next time you start MATLAB. For more information about the userpath folder, see userpath Folder on the Search Path
There are three ways to change the folders on the search path for the current MATLAB session only:
Use the Set Path dialog box to make changes to the search path, and do not save the changes.
On the Home tab, in the Environment section, click Set Path.
After making the changes, click Close.
Use the Current Folder browser to add or remove folders from the search path.
From the Current Folder browser, select, and then right-click the folder or folders to add or remove.
From the context menu, select Add to Path or Remove from Path, and then select an option:
Selected Folders and Subfolders
In the Editor, you also can add or remove the folder that contains an Editor document from the search path. Right-click the document tab, and then select an option to Add or Remove the folder from the Search Path.