Code covered by the BSD License  

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

» Watch video

Highlights from
Folders tree files list

5.0
5.0 | 1 rating Rate this file 15 Downloads (last 30 days) File Size: 8.63 KB File ID: #41170 Version: 1.1
image thumbnail

Folders tree files list

by

Nikolay S. (view profile)

 

08 Apr 2013 (Updated )

Returns cell array of file names located under input folders.

| Watch this File

File Information
Description

This functions goal is to return a cell array of names of files located under user defined folders. The input should be a cell array of parent directories. The function also supports input of a single directory name string. Absolute file path is used, replacing the relative path.
The user can choose the files or directories including files using the OS explorer- by enabling the 'flagGUI' input.
I was somewhat un-pleased from the multiple similar function were proposed and submitted to Matlab File exchange (no offence, with greatest respect to the authors and their work):
   - http://www.mathworks.com/matlabcentral/fileexchange/index?term=tag%3A%22directories%22&sort=downloads_desc
  - http://www.mathworks.com/matlabcentral/fileexchange/index?term=tag%3A%22files%22&sort=downloads_desc
  - http://www.mathworks.com/matlabcentral/fileexchange/index?term=tag%3A%22dir%22&sort=downloads_desc
During my first programming course I was taught that code using recursion is a bad code. Recursive code is hard to understand, develop and maintain.
Changing folders or Matlab path during run time is also a bad thing- it takes more time and can cause unwanted effects in Matlab environment.
Therefore I've written my implementation, witch, I believe, has some advantages over methods proposed earlier:
  - It is not recursive but iterative.
  - It does not changes the current folder (not using cd command).
  - It uses "ls" function, which is supposed to be faster then "dir" function.
  - According to some measurements I've made it runs faster the the alternatives.
  - I also believe is is clearly written, so it should be easy to understand and maintain.
  - It supports wildCards.

Acknowledgements

Folders Sub Folders inspired this file.

This file inspired 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)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
30 Mar 2016 Tanmay Rajpathak  
Updates
22 Apr 2013 1.1

Some bug fixes and modifications

Contact us