I want to save multiple images in a folder?

12 ビュー (過去 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 Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by