MATLAB: I want to read images whose names are numbers in increment of 1. How to efficiently use a loop to do this task

imread function for incrementing strings

I need to read a 1*n image and store the intensity of every point in a txt file. The names of the images are in increment of numbers (eg- Image01.tif, Image02.tif and so on). How can I employ a for loop to do the task ? I am using imread function to do the job, but I have difficulty in incrementing the string (name) and using imread function simultaneously. Can someone help me please.

Best Answer

images = cell(n, 1);
for K = 1 : n
filename = sprintf('Image%02d.tif', K);
images{K} = imread(filename);
end
Related Question