How I can read '2.tif' before '19.tif'?(my tif files are named as: 1.tif, 2.tif, 3.tiff, ..., 10.tif, 11.tif, ..., 19.tif, 20.tif)

3 views (last 30 days)
Hello, Everyone. I have a folder with 100 tif format images, their names are 1.tif, 2.tif, ..., 100.tif. I wnant read these files from 1 to 100 one after another. I firstly use dir to list all tif image names. But in the listed names, the 2.tif was arranged after 19.tif, the 3.tif was arranged after 29.tif. How can I read 2.tif after 1.tif(before 19.tif)?

Accepted Answer

Image Analyst
Image Analyst on 27 Jul 2017
See Stephen's File Exchange which was a "Pick of the Week": http://blogs.mathworks.com/pick/2014/12/05/natural-order-sorting/

More Answers (0)

Categories

Find more on 数据导入和分析 in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!