reshaping a matrix in a special way

17 views (last 30 days)
Rica
Rica on 13 Nov 2012
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)

Andrei Bobrov
Andrei Bobrov on 13 Nov 2012
B = reshape(permute(reshape(A,3,2,[]),[2 1 3]),2,[]);

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!