crawl_directories(file, varargin)
This function crawls directories to search for a specific file (e.g. "MyPicture.png") or all files specified by wildcards (e.g. "*.png") and returns all found occurences as a cell array containing the full path name(s).
Additional parameters may be specified as parameter-value pairs to determine the starting directory ('path'), the search direction ('direction'), the maximum number of files to be retrieved ('n') and the maximum number of directory levels to search ('depth'). Please refer to the help for details.
Examples
========
files = crawl_directories('*.png'); % Find all png-files below current directories
files = crawl_directories('MyPic.png', 'path','d:\pictures'); % Search for MyPic.png starting in d:\pictures
files = crawl_directories('*.m', 'path','d:\Matlab','n',40); % Find at most 40 m-files starting in d:\Matlab
Cite As
Sebastian Hölz (2024). crawl_directories(file, varargin) (https://www.mathworks.com/matlabcentral/fileexchange/56722-crawl_directories-file-varargin), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |