View License

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

» Watch video

Highlights from
folders sub-folders

Be the first to rate this file! 9 Downloads (last 30 days) File Size: 4.34 KB File ID: #41135 Version: 1.2
image thumbnail

folders sub-folders


Nikolay S. (view profile)


04 Apr 2013 (Updated )

Returns cell array of folder names located under input list (cell array) of folders. Non recursive!

| Watch this File

File Information

This functions goal is to return a list (cell array) of names of sub-folders located under user defined folders list. The input should be a a cell array of parent directories names. The function also supports input of a single directory name string.
Alternatively, the user can choose the folders using the OS explorer- by enabling the 'flagGUI' input.
   Function properties:
       - It is not recursive but iterative.
       - It does not change the current folder (not using "cd" command).
       - It uses "ls" function, which is supposed to be faster than "dir" function.
       - According to some measurements I've made it runs faster than the alternatives.
       - I also believe it is clearly written and documented, so it should be easy to understand and maintain.


Subdir *New* inspired this file.

This file inspired Folders Tree Files List, List Of Files From Directories/Files List Or Browser, Files To Folders Based On Properties, and Apply2 Video Frames.

Required Products MATLAB
MATLAB release MATLAB 8.0 (R2012b)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
26 Oct 2014 Nikolay S.

Nikolay S. (view profile)

Hi Pawel.
You are 100% correct. I've exported the sub-function "folderFullPath", and forgot to add the file to this submission. Please get the updated version, once it is uploaded.
In case of problems, do not hesitate to contact me.
Best regards,

Comment only
26 Oct 2014 Pawel

Pawel (view profile)

Does not work on Matlab R2014a.
"Undefined function 'folderFullPath' for input arguments of type 'char'."

Comment only
22 Apr 2013 1.1

Minor modifications

26 Oct 2014 1.2

Sub function was exported to a stand alone function for use in other scenarios.

Contact us