Thursday, June 12, 2008

reshape - How to reshape a Matrix or a Vector in Matlab

The following code transforms a Matrix A


A =

1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20

into a vector, in the order shown in A.

reshape(flipud(rot90(A)),[],1)

No comments: