MATLAB Function Reference Previous page   Next Page
what

List MATLAB files in current directory

Graphical Interface

As an alternative to the what function, use the Current Directory browser. To open it, select Current Directory from the Desktop menu in the MATLAB desktop.

Syntax

Description

what lists the M, MAT, MEX, MDL, and P-files and the class directories that reside in the current working directory.

what dirname lists the files in directory dirname on the MATLAB search path. It is not necessary to enter the full pathname of the directory. The last component, or last two components, is sufficient.

what class lists the files in method directory, @class. For example, what cfit lists the MATLAB files in toolbox/curvefit/curvefit/@cfit.

s = what('dirname') returns the results in a structure array with these fields.

Field
Description
path
Path to directory
m
Cell array of M-file names
mat
Cell array of MAT-file names
mex
Cell array of MEX-file names
mdl
Cell array of MDL-file names
p
Cell array of P-file names
classes
Cell array of class names

Examples

List the files in toolbox/matlab/audio:

Obtain a structure array containing the MATLAB filenames in toolbox/ matlab/general.

See Also

dir, exist, lookfor, mfilename, path, which, who


Previous page  weekday whatsnew Next page

© 1994-2005 The MathWorks, Inc.