MATLAB Function Reference Previous page   Next Page
cd

Change working directory

Graphical Interface

As an alternative to the cd function, use the current directory field in the MATLAB desktop toolbar.

Syntax

Description

cd displays the current working directory.

w = cd assigns the current working directory to w.

cd('directory') sets the current working directory to directory. Use the full pathname for directory. On UNIX platforms, the character ~ is interpreted as the user's root directory.

cd('..') changes the current working directory to the directory above it.

cd directory or cd .. is the unquoted form of the syntax.

Examples

On UNIX

changes the current working directory to demos.

On Windows

changes the current working directory to demos. Then typing

changes the current working directory to matlab.

See Also

dir, fileparts, mfilename, path, pwd, what


Previous page  caxis cdf2rdf Next page

© 1994-2005 The MathWorks, Inc.