MATLAB: How to read multiple jpg images in matlab

faqimage analysisimage processingImage Processing Toolbox

i have 250 jpg images stored at in_dir = 'C:\Users\DJDJ\Desktop\pic';
these pictures are arranged as following and named : image1 , image2, image3…..image250
I want to read all these images and processing them starting by image1 after processing go to process image2 .and after image3.to..image250
then saved the resultant images after preproceesing in a specific file,for example at out_dir = 'C:\Users\DJDJ\Desktop\pic output';.
How can i do this in matlab?
thank you in advance

Best Answer

you can use a for loop and save the image data in a cell:
replace png by the file type of your images. result will be a 1x250 cell array
for i= 1:250
x{i}=imread(['image',num2str(i),'.png'])
end
>> save('image_Data','x')