SEARCHFILE
Here is the help comments for the file which will provide an overview.
% SEARCHFILE search for files and/or directories under a given folder
% Syntax
% list = searchfile('dir', 'filter', 'recflag')
%
% 'dir'(Optional) -
% The source directory where to search. If not specified,
% current working directory will be used
%
% 'filter'(Optional) -
% File filter('*.txt', 'ABC*.*' etc)
%
% 'recflag'(Optional) -
% 1 = Recurse into subdirectory, otherwise look only in
% the specified/current directory
%
% Eg: list = searchfile('C:\Temp', '*.txt', 1);
% list = searchfile('*.txt', 1);
% list = searchfile(1);
%
% Return value : Structure with following fields
% 'name' - Name of the file/directory
% 'path' - Path to the file/directory
% 'fullpath' - Full path of the file/directory including its
% name
% 'isdir' - Flag indicates whether a directory or file
% 1 = Directory, 0 = File
%
Cite As
Rahul Prem Nazeer (2024). SEARCHFILE (https://www.mathworks.com/matlabcentral/fileexchange/24567-searchfile), 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.