display multiple image in one figure window using for loop

조회 수: 3 (최근 30일)
mukesh gupta
mukesh gupta 2016년 10월 30일
댓글: Meghana Balasubramanian 2019년 9월 23일
my image database folder has images named 1.bmp,2.bmp..and so on i want to use for loop (1 to 5) and display five images in one window how to do it?

채택된 답변

Walter Roberson
Walter Roberson 2016년 10월 30일
for K = 1 : 5
this_image = imread( sprintf('%d.bmp', K) );
ax = subplot(1, 5, K);
imshow(this_image, 'Parent', ax);
end
  댓글 수: 4
mukesh gupta
mukesh gupta 2016년 10월 31일
thank you walter
Meghana Balasubramanian
Meghana Balasubramanian 2019년 9월 23일
Hey Walter,
I was wondering how to save this image once its displayed. I read up on the imwrite function and tried to implement it in my code, but I was unable to do so.
Do let me know if I should ask this as a separate question.
Thank you!

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

추가 답변 (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