MATLAB Function Reference    
path

Control the 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 be comprised of those directories named in the string, 'newpath'.

path(path,'newpath') appends a new directory to the current search path.

path('newpath',path) prepends a new directory to the current search path.

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

Remarks

For more information on how MATLAB uses the directory search path, see How Functions Work and How MATLAB Determines Which Method to Call.

Examples

To add a new directory to the search path on Windows,

To add a new directory to the search path on UNIX,

See Also

addpath, genpath, cd, dir, partialpath, rehash, rmpath, what


 Patch Properties pathtool