display multiple image in one figure window using for loop

8 ビュー (過去 30 日間)
mukesh gupta
mukesh gupta 2016 年 10 月 30 日
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 Center および File ExchangeImages についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by