MATLAB Function Reference |
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.
lists the files in method directory, what
class
@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.
Examples
List the files in toolbox/matlab/audio:
what audio M-files in directory matlabroot/toolbox/matlab/audio Contents auread soundsc audiodevinfo auwrite wavplay audioplayer lin2mu wavread audioplayerreg mu2lin wavrecord audiorecorder prefspanel wavwrite audiorecorderreg saxis audiouniquename sound MAT-files in directory matlabroot/toolbox/matlab/audio chirp handel splat gong laughter train
Obtain a structure array containing the MATLAB filenames in toolbox/ matlab/general
.
s = what('general') s = path: 'matlabroot:\toolbox\matlab\general' m: {104x1 cell} mat: {0x1 cell} mex: {5x1 cell} mdl: {0x1 cell} p: {'helpwin.p'} classes: {'char'}
See Also
dir
, exist
, lookfor
, mfilename
, path
, which
, who
weekday | whatsnew |
© 1994-2005 The MathWorks, Inc.