MATLAB: Reshaping a matrix dimension

matrix reshaping

Hi, I have a 2×60 matrix and I want to reshape it to a 120×1 matrix. How can I do that?

Best Answer

It depends on how you want the (120x1) matrix to look. Here are two possibilities:
A = [1:5; 6:10];
B1 = reshape(A, [], 1);
B2 = reshape(A', [], 1);
Related Question