Unfortunately, matlab's strcmp is less functional than C's strcmp and can't really be used for the sort of comparison you want. You have several options though:
If all you want to do is group the filename by their hundred, you could just compare the first two digits of the filenames, with strncmp: MatchedImage = Images(strncmp(Images, '13', 2));
This won't work if you want something finer grained than thousand, hundred, decade, or unit. For that, you could use a regular expression and test if it match with isempty. Finally, you could convert the numeric part of your strings into double and do the comparison based on that. You can use str2double but you need to make sure your strings are just numbers. For that a simple regex would suffice:
ImageNumbers = str2double(regexp(Images, '\d+', 'match', 'once'));
MatchedImages = Images(ImageNumbers <= 1399 & ImageNumbers >= 1300);
This latter option gives you the most flexibility.
Best Answer