how to display multiple images?

2 visualizaciones (últimos 30 días)
kitty varghese
kitty varghese el 12 de Sept. de 2017
Comentada: kitty varghese el 27 de Oct. de 2017
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 comentario
José-Luis
José-Luis el 12 de Sept. de 2017
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?

Iniciar sesión para comentar.

Respuesta aceptada

KSSV
KSSV el 12 de Sept. de 2017
Editada: KSSV el 12 de Sept. de 2017
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 comentario
kitty varghese
kitty varghese el 27 de Oct. de 2017
what changes should i make if i need to montage the images using the first code?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Images en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by