Getting Started Previous page   Next Page

Current Directory Browser and Search Path

MATLAB file operations use the current directory and the search path as reference points. Any file you want to run must either be in the current directory or on the search path.

Current Directory

A quick way to view or change the current directory is by using the current directory field in the desktop toolbar, shown here.

To search for, view, open, and make changes to MATLAB related directories and files, use the MATLAB Current Directory browser. Alternatively, you can use the functions dir, cd, and delete. Use the Visual Directory and Directory Reports to help you manage M-files.

Search Path

MATLAB uses a search path to find M-files and other MATLAB related files, which are organized in directories on your file system. Any file you want to run in MATLAB must reside in the current directory or in a directory that is on the search path. When you create M-files and related files for MATLAB, add the directories in which they are located to the MATLAB search path. By default, the files supplied with MATLAB and other MathWorks products are included in the search path.

To see which directories are on the search path or to change the search path, select File -> Set Path and use the resulting Set Path dialog box. Alternatively, you can use the path function to view the search path, addpath to add directories to the path, and rmpath to remove directories from the path.


Previous page  Help Browser Workspace Browser and Array Editor Next page

© 1994-2005 The MathWorks, Inc.