필터 지우기
필터 지우기

How to read jpg images in a loop

조회 수: 24 (최근 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 CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by