F = rdir(NAME) returns a cell array of file names matching NAME.
NAME may be a cell array of strings, and may contain cascading
pathnames separated by '/' followed by a filename. Wildcards may be
used both in the final filename, as in DIR, but also in the
intermediate pathnames. For example, F=rdir('mydir*/*.m') returns all
the M-Files contained in each directory that begins with 'mydir'.
In addition, brackets [] may also be used (see expandstr), both in the
pathnames and in the filename. If wildcards or brackets are present in
the pathnames, rdir lists recursively all the directories matching the
pathnames.
rdir file_name or rdir('file_name') displays the result.
F = rdir(NAME,'fileonly') only returns file names.
F = rdir(NAME,'dironly') only returns directory names, but does not
list their content.
F = rdir(NAME,'filedir') returns both files and directories (as DIR).
(Note that, when options 'dironly' or 'filedir' are used, the
fictitious directories '.' (current) and '..' (parent) are not
returned, contrarily to DIR). (by default)
Examples
F = rdir('set*/B[1:8,2].v*') returns the file names matching
'B01.v*' to 'B08.*' in each directory matching 'set*'.
F = rdir('set[1 2 3]*/*/B01.vec') returns the file name 'B01.vec',
if present, in all the subdirectories of each directory matching
'set1*', 'set2*', 'set3*'.
See Also
expandstr, DIR.