Path

August 12th, 2009 Posted in Functions

Get/set search .
PATH, by itself, prettyprints MATLAB’s current search path. The
initial search path list is set by PATHDEF, and is perhaps
individualized by STARTUP.

P = path returns a string containing the path in P.
path(P) changes the path to P. path(PATH) refreshes MATLAB’s
view of the directories on the path, ensuring that any changes
to non-toolbox directories are visible.

path(P1,P2) changes the path to the concatenation of the two path
strings P1 and P2. Thus path(PATH,P) appends a new directory to
the current path and path(P,PATH) prepends a new path. P1 or
P2 are already on the path, they are not added.

For example, the following add another directory
to MATLAB’s search path on various operating systems:

Unix:

1
path(path,'/home/myfriend/goodstuff')

Windows:

1
path(path,'c:\tools\goodstuff')

See also what, cd, dir, addpath, , genpath,

Leave a Reply

You must be logged in to post a comment.