How to read jpg images in a loop

2 ビュー (過去 30 日間)
Hashem Burki
Hashem Burki 2011 年 3 月 3 日
回答済み: ck 2020 年 1 月 15 日
Hi, I'm new in this. I have 4 images named: img1.jpg, img2.jpg, img3.jpg, and img4.jpg. All i have to do is read them one by one in a for loop. How can i do that?

採用された回答

Paulo Silva
Paulo Silva 2011 年 3 月 3 日
c=cell(1,4);
for i=1:4
c{i}=imread(sprintf('img%d.jpg',i));
end
  3 件のコメント
preeti
preeti 2014 年 12 月 24 日
hi if i want to show images also what i hav to add in this code.
Image Analyst
Image Analyst 2014 年 12 月 24 日
put this in the loop
subplot(2,2,i);
imshow(c{i});

サインインしてコメントする。

その他の回答 (1 件)

ck
ck 2020 年 1 月 15 日
How can I loop through images I read in, when the images have different names and numbers?

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by