The DIR and LS functions in MATLAB do not sort numerical filenames in numerical order.
For example, I have filenames of the form:
1-1-1.tif 1-1-2.tif 1-1-3.tif . . . 1-1-9.tif 1-1-10.tif 1-1-11.tif
However, when I use DIR or LS to list the files using:
files=dir('*.tif')
The results stored in "dir.name" are:
1-1-1.tif 1-1-10.tif 1-1-11.tif 1-1-2.tif 1-1-3.tif 1-1-9.tif
I would like to order these numerically.
Best Answer