reshaping a matrix in a special way

Hi!
How to reshape this matrix:
% A= 1 2
3 4
5 6
7 8
9 1
8 5
. .
. .
to this matrix
%B=1 3 5 2 4 6
7 9 8 8 1 5
. . . . . .
i didnot get it with reshape
Thnx

Answers (1)

B = reshape(permute(reshape(A,3,2,[]),[2 1 3]),2,[]);

Categories

Tags

Asked:

on 13 Nov 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!