File Exchange

image thumbnail

Recursive DIR

version 1.1 (2.61 KB) by

DIRREC finds files recursively in a given folder



View License

Find files recursively in a given folder.
      C=dirrec('c:\windows') returns a cell C with the full pathname of all
       files in the c:\windows folder and all its sub-folders.
      C=dirrec('c:\windows','.exe') idem but returns only the files with
       extension .exe.

      C=dirrec('c:\windows','co*') idem but returns only the files starting with the two letters co (comsetup.log, control.ini, ...).
      C=dirrec('c:\windows',{'.exe','.dll') idem but returns files with both
       .exe and .dll extensions.
      dirrec('c:\windows','.cmd') only displays the list of the .cmd files in
       the Matlab command window
      Note that extension should be given in lower case.
I was using the DDIR function by Maximilien Chaumon but it was not possible to compile ddir so I write my own function.


Comments and Ratings (4)


David (view profile)

fantastic. great work.

Bob Hamans

Have a look at for more extensive search patterns not only by extension.

David Chandler

Very useful.

s b




BSD license added

MATLAB Release
MATLAB 6.5 (R13)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video