I want to save multiple images in a folder?

조회 수: 10 (최근 30일)
Shashank Srivastava
Shashank Srivastava 2018년 3월 15일
댓글: Sukesh Immadisetty 2020년 3월 31일
I made the code but the looping variable comes in the string function so a single image is saved in the folder. Is any other way of separating the looping variable from the colon bars.
img=imread('cameraman.tif');
for i=1:5
img=imread('http://satellite.imd.gov.in/img/3Dnesec_ir1.jpg')
imwrite(img,'D:\output database\i.jpg','jpg')% x be a image to write
end

채택된 답변

Jan
Jan 2018년 3월 15일
편집: Jan 2019년 8월 26일
  댓글 수: 3
Stephen23
Stephen23 2019년 8월 26일
Using fullfile makes the path definition simpler:
for k = 1:5
FileName = fullfile('D:\output database',sprintf('%d.jpg',k))
...
end
Sukesh Immadisetty
Sukesh Immadisetty 2020년 3월 31일
what to give in place of file name

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by