MATLAB: How to display multiple images displayplot if trueA = 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. Best Answer Optioin 1: Using subplotA = rand(361,285);B = reshape(A,19,19,19,15);%%Save each 19*19 matrix into imagefor i = 1:19 for j = 1:15 idx = sub2ind([15,19],j,i) ; subplot(19,15,idx) ; imshow(B(:,:,i,j)) drawnow endendOption 2: Using montageA = rand(361,285);B = reshape(A,19,19,19,15);%%Save each 19*19 matrix into imagefnames = 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}) ; endend montage(fnames, 'Size', [19, 15]); Related SolutionsMATLAB: I have a matrix W of 361*285.I want to create a matrix such that each column(1*285) of the matrix is reshaped into a matrix of (19*19)(read as atom)such that the atoms are concatenated into a 19*15 matrix A = rand(361,285);B = reshape(A,19,19,19,15); MATLAB: How to multiply a matrix with scalar A = rand(361,49);B = reshape(A,19,19,1,49);H=rand(49,1);A = zeros(19,19) ;for i = 1:49 A = A+H(i)*B(:,:,1,i) ;end Related QuestionProblem with dsolve: Unable to find explicit solutionI have A=150×1 matrix, i want to create another matrix of size B=15×10 where the 1st column contains 1st 15 data of matrix A and the 2nd column can contain the next 15 data and so one. So please helpFixing an error for calling a variable in an arrayHow to read and store greyscaleimage into single matrix
Best Answer