No License

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

» Watch video

Highlights from

4.7 | 3 ratings Rate this file 5 Downloads (last 30 days) File Size: 1.12 KB File ID: #1570 Version: 1.0




Lists all subdirectories in the current or a given directory.

| Watch this File

File Information

The function uses the MATLAB "dir" function to create a structure of sub-directories.


This file inspired Subdir.

MATLAB release MATLAB 6.1 (R12.1)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
28 Apr 2008 Rob Jenkin

This is good - but caution - if in the root directory of a disc '.' and '..' are not returned in dir, so you potentially lose a sub dir. I've added a test, D(i).name == '.' to test for this and adjust accordingly.

18 Mar 2006 Erdinc Saygin

Very handy and simple to use. Thank you very much Paul!

11 May 2005 Tim Myers

This is exactly what I needed. I'm glad I found it on the Matlab File Exchange. Nice job Paul.

Contact us