MATLAB: Transfering the one row matrix into multiple row matrix with the same data MATLABmatrix manipulation How can I transfer the one row matrix A into multiple row matrix A' with the same data just like below: A=[3 0 0 0 2 8 1 0 4]A' = [3 0 0;0 2 8; 1 0 4] Best Answer You can use reshape and transpose:>> A = [3,0,0,0,2,8,1,0,4];>> reshape(A,3,3).'ans = 3 0 0 0 2 8 1 0 4 Related SolutionsMATLAB: Reshape of multidimesion matrix to single dimension matrix. C(:)orC(:).'orreshape(C, [], 1)orreshape(C, 1, []) MATLAB: Ranking matrix by rows EDIT[~,jj]=sort(a,2,'descend');[~,b]=sort(jj,2) Related QuestionLooping for replace matrix elementsFilter a matrix based on the data of each rowI get the following error “Dimensions of arrays being concatenated are not consistent.”RowsConditionally deleting matrix rows
Best Answer