From: Thomas Ibbotson on
I am currently finding files in a directory using the following code:
re = 'some regular expression';
f = dir('.');
matchingFiles = f(cellfun(@(x) ~isempty(regexp(x, re, 'once')), {f.name})).name;

Somehow I feel there must be a better way to do this. Does anyone have any suggestions?

Tom