MATLAB Function Reference
  Go to function:
    Search    Help Desk 
what    Examples   See Also

Directory listing of M-files, MAT-files, and MEX-files

Syntax

Description

what by itself, lists the M-files, MAT-files, and MEX-files in the current directory.

what dirname lists the files in directory dirname on MATLAB's search path. It is not necessary to enter the full pathname of the directory. The last component, or last couple of components, is sufficient. Use what class or what dirname/private to list the files in a method directory or a private directory (for the class named class).

w = what('dirname') returns the results of what in a structure array with the fields:

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

The statements

and

both list the M-files in the general directory. The syntax of the path depends on your operating system:

UNIX:

matlab/general
VMS:

MATLAB.GENERAL
MS-DOS:

MATLAB\GENERAL
Macintosh:

MATLAB:General

See Also

dir         Directory listing

lookfor     Keyword search through all help entries

path        Control MATLAB's directory search path

which       Locate functions and files

who         List directory of variables in memory



[ Previous | Help Desk | Next ]