File and folder names in a given directory

Simple function to get the file and folder names within a directory, with options for basic filtering and string removal

https://github.com/LJ-Jenkins/matlab_misc

You are now following this Submission

% 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 .

Tags

Add Tags

Add the first tag.

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0