| MATLAB Function Reference | ![]() |
Graphical Interface
As an alternative to the cd function, use the Current Directory field in the MATLAB desktop toolbar.
Syntax
cd
w = cd
cd('directory')
cd('..')
cd directory or cd ..
Description
cd
prints out 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. Note that you cannot access the top level of a UNC pathname.
cd directory or cd ..
is the unquoted form of the syntax.
Examples
cd('/usr/local/matlab/toolbox/demos')
changes the current working directory to demos.
cd('C:\TOOLBOX\MATLAB\DEMOS')
changes the current working directory to DEMOS. Then typing
cd ..
changes the current working directory to MATLAB.
See Also
| caxis | cdf2rdf | ![]() |