Folders tree files list

版本 1.1.0.0 (8.6 KB) 作者: Nikolay S.
Returns cell array of file names located under input folders.
1.3K 次下载
更新时间 2013/4/22

查看许可证

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.

引用格式

Nikolay S. (2024). Folders tree files list (https://www.mathworks.com/matlabcentral/fileexchange/41170-folders-tree-files-list), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2012b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 File Operations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.1.0.0

Some bug fixes and modifications

1.0.0.0