searchfiles shows a dialog to search files recursively
files = searchfiles
files = searchfiles(startfolder, filterspec, limit, dialogname)
[files, startfolder, limit, option] = searchfiles(startfolder,...
filterspec, limit, dialogname, optiontext, optiondefault)
A dialog is shown where the user can search files recursively using
wildcard symbols (* and **), with the option to limit the number of files
per folder, and with an optional custom checkbox.
INPUT ARGUMENTS (all arguments are optional):
startfolder = root folder to start search (default is pwd)
filterspec = search string, supports wildcards same as dir (default
limit = limit number of files per folder (default is 0 = no limit)
dialogname = figure name of the dialog window (default = 'Search files')
optiontext = text label of an optional checkbox. the checkbox is only
shown if optiontext is not empty (default is empty)
optiondefault = initial state of the optional checkbox (default is
files = cell array of strings of selected file names, if cancel is
clicked files is 0
startfolder = root folder (same as input unless the user browsed to a
new folder in the dialog)
limit = same as input unless user changed number in dialog
option = state of the optional checkbox (true or false)
Bramvg (2021). searchfiles (https://www.mathworks.com/matlabcentral/fileexchange/72576-searchfiles), MATLAB Central File Exchange. Retrieved .
searchfiles does not replace the built-in file searching tool. It is more meant as replacement of uigetfile, with the option to search files recursively.
Note that MATLAB includes an inbuilt file searching tool:
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!