Simple function to get the file and folder names within a directory, with options for basic filtering and string removal
You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
% fnames - gets the file and folder names within a directory
%
% Inputs:
% directory - directory containing the files/folders
% -name-value arguments-
% 'contains' - (optional) string to filter the file names
% 'erase' - (optional) string to erase from the file names
%
% Outputs (in order):
% files - names of the file/s
% folders - names of the folder/s
Cite As
Luke Jenkins (2026). File and folder names in a given directory (https://uk.mathworks.com/matlabcentral/fileexchange/163526-file-and-folder-names-in-a-given-directory), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.0 (1.38 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0 |
