MATLAB Function Reference Previous page   Next Page
path

View or change MATLAB directory search path

Graphical Interface

As an alternative to the path function, use the Set Path dialog box. To open it, select Set Path from the File menu in the MATLAB desktop.

Syntax

Description

path displays the current MATLAB search path. The initial search path list is defined by toolbox/local/pathdef.m.

path('newpath') changes the search path to newpath, where newpath is a string array of directories.

path(path,'newpath') adds the newpath directory to the bottom of the current search path.

path('newpath',path) adds the newpath directory to the top of the current search path.

p = path(...) returns the specified path in string variable p.

Examples

Add a new directory to the search path on Windows.

Add a new directory to the search path on UNIX.

See Also

addpath, cd, dir, genpath, matlabroot, partialpath, pathdef, pathsep, pathtool, rehash, restoredefaultpath, rmpath, savepath, startup, what

Search Path topic in the MATLAB Desktop Tools and Development Environment documentation


Previous page  Patch Properties path2rc Next page

© 1994-2005 The MathWorks, Inc.