MATLAB: Convert matrix size from 1xmxn to mxn squeeze I want to compare two matrices. One's size is mxn and the other matrix size 1xmxn. How can I convert 1xmxn to mxn?? Best Answer Z = randi(250,1,3,4); % your matrixone wayout = squeeze(Z)';otherout = permute(Z,[3 2 1]);orout = reshape(Z,size(Z,2),[])'; Related SolutionsMATLAB: Initialize a multidimensional matrix N=6;m=4;A=zeros(repmat(m,1,n)); MATLAB: How to convert from cell array to multidimensional array A -your cell array [3 x 3].Z = cellfun(@(x)reshape(x,1,1,[]),A,'un',0);out = cell2mat(Z); Related QuestionHow to convert a 1x1x50 matrix to a vectorAdding zeros to a matrix to match the dimensions of two matrices.Return value of rgb2gray
Best Answer