Reshape 59x16 double into 236x4?

Viewed 83

How can I reshape a matrix in MATLAB, preferably using reshape?

A simple matrix setup:

A = [1 4 7 10; 2 5 8 11; 3 6 9 12]

that I want to reshape into

B = [1 4; 2 5; 3 6; 7 10; 8 11; 9 12]

I've tried numerous settings of reshape, but I cannot figure it out.

1 2 3 4
5 6 7 8

reshaped into

1 2
5 6
3 4
7 8
3 Answers
Related