searchfiles
searchfiles shows a dialog to search files recursively
SYNTAX:
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
is '\**\*.*')
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
false)
OUTPUT ARGUMENTS:
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)
Cite As
Bramvg (2026). searchfiles (https://www.mathworks.com/matlabcentral/fileexchange/72576-searchfiles), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0 |
