MATLAB: How to set the UIGETFILE filter in MATLAB 7.5 (R2007b)

filterspecMATLAB

I would like to return a filtered list of the files in a directory. When I use the following code in MATLAB 7.5 (R2007b), UIGETFILE does not ouput a filtered list of files.
Filter = '*2007*';
DefaultFileName = 'log.mat';
Title = 'Title';
uigetfile(Filter,Title,DefaultFileName);
But, this code produced a filtered list in MATLAB 7.3 (R2006b)

Best Answer

To set the filter specification in MATLAB 7.5 (R2007b), the filter term(s) must have a file extension. Any extension will be accepted for a filter, even the wildcard character . If no extension is provided, the UIGETFILE filter will reset back to the default '.*'. To achieve the desired results, use the following code:
Filter = '*2007*.*';
DefaultFileName = 'log.mat';
Title = 'Title';
uigetfile(Filter,Title,DefaultFileName);