Clear Filters
Clear Filters

hello everyone. I would like to ask how to use the loop statement batch save picture and import pictures. The names of the pictures are: 1.jpg; 2.jpg; 3.jpg;... Thank you very much.

1 view (last 30 days)
Save picture:
Folder = 'C:\Users\wenhuaiyu\Desktop\';
for k=1:numel(s)
imwrite(Obj, fullfile(Folder, sprintf('%02d.jpg',k)));
import pictures:
for i=1:numel(s) %suppose there are 10 image

Accepted Answer

Image Analyst
Image Analyst on 21 May 2021
This is a FAQ, so see the FAQ:
In the loop have imread() to import, then do your stuff, then use imwrite() to save any changes to a new image file.

More Answers (0)


Find more on Introduction to Installation and Licensing 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!