I have a regular expression defining the filenames of interest. What is the best way to list all files in a directory that match this condition?
My attempt at this i
Suppose you have a cell array with possible extensions, e.g., exts = {'avi','mp4'}. Then you can do the following
exts = {'avi','mp4'}
f = cellfun( @(x) dir( fullfile( DIR, ['*.',x] ) ), exts, 'UniformOuput', false ); result = [f{:}];