Directory listing
Syntax
dir
dir dirname
names = dir
names = dir('dirname
')
Description
dir,
by itself, lists the files in the current directory.
dir dirname
lists the files in the specified directory. Use pathnames, wildcards, and any options available in your operating system.
names = dir('dirname
') or names = dir
returns the results in an m
-by-1
structure with the fields:
name
|
Filename
|
date
|
Modification date
|
bytes
|
Number of bytes allocated to the file
|
isdir
|
1 if name is a directory; 0 if not
|
Examples
cd /Matlab/Toolbox/Local; dir
Contents.m matlabrc.m siteid.m userpath.m
names = dir
names =
4x1 struct array with fields:
name
date
bytes
isdir
See Also
!
, cd
, delete
, type
, what
[ Previous | Help Desk | Next ]