Если вы заранее не знаете, какие файлы будут там, но вы знаете, что в них есть строка, 'rawImage'
(например, 'rawImage001.jpg'
и т. Д.), Вы можете сделать что-то вроде
a = dir('c:\temp');
requiredBaseFileName = 'rawImage'; % you want them to contain the substring 'rawImage'
for i = 1:length(a),
fileName = a(i).name;
if(isempty(strfind(fileName,'.jpg')) & isempty(strfind(fileName,'.png')))
continue;
end
if(isempty(strfind(fileName,requiredBaseFileName)))
continue;
end
% do your processing here
end