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

List M-files, MAT-files, and MEX-files in current directory

Syntax

Description

what 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 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

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
Windows

MATLAB\GENERAL
.

See Also

dir, lookfor, path, which, who



[ Previous | Help Desk | Next ]