フィルターのクリア

how to display multiple images?

1 回表示 (過去 30 日間)
kitty varghese
kitty varghese 2017 年 9 月 12 日
コメント済み: kitty varghese 2017 年 10 月 27 日
if true
A = rand(361,285);
B = reshape(A,19,19,19,15);
end
I want to display each 19*19 into an image into 19*15 subplots under one figure.
  1 件のコメント
José-Luis
José-Luis 2017 年 9 月 12 日
285 subplots in one figure? That ain't gonna be pretty.
What part of the subplot() documentation did you not understand when you read it?

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

採用された回答

KSSV
KSSV 2017 年 9 月 12 日
編集済み: KSSV 2017 年 9 月 12 日
Optioin 1: Using subplot
A = rand(361,285);
B = reshape(A,19,19,19,15);
%%Save each 19*19 matrix into image
for i = 1:19
for j = 1:15
idx = sub2ind([15,19],j,i) ;
subplot(19,15,idx) ;
imshow(B(:,:,i,j))
drawnow
end
end
Option 2: Using montage
A = rand(361,285);
B = reshape(A,19,19,19,15);
%%Save each 19*19 matrix into image
fnames = cell(1,19*15) ;
for i = 1:19
for j = 1:15
idx = sub2ind([15,19],j,i) ;
fnames{idx} = strcat(num2str(idx),'.jpeg') ;
imwrite(B(:,:,i,j),fnames{idx}) ;
end
end
montage(fnames, 'Size', [19, 15]);
  1 件のコメント
kitty varghese
kitty varghese 2017 年 10 月 27 日
what changes should i make if i need to montage the images using the first code?

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDisplay Image についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by