MATLAB: Move matrix rows and columns move matrix rows and columnsreshape I have a n*n matrix. I want to convert it to n^2*1 matrix. for example: A=[a b;c d] result B=[a;b;c;d] Best Answer B=reshape(A.',[],1); Related SolutionsMATLAB: Transfer a matrix in a quick way If you want to preserve each 4x3 block, you could try something like this:B = reshape(A(:, [1:3:end, 2:3:end, 3:3:end]), [], 3 ); MATLAB: Move rows in a matrix Use MATLAB's rather powerful indexing ability: X = [...]; X = X([1,6,7,8,2,9,10,11,3,4,5],:); Related QuestionMATLAB function for reordering the matrix rows and columns as desiredAverage of matrix elementReshaping/vectorizing a n-d matrix to a vector along each dimensionBuilding a square matrix out of a vector
Best Answer