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

답변 (1개)

Andrei Bobrov
Andrei Bobrov 2012년 11월 13일

1 개 추천

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

카테고리

도움말 센터File Exchange에서 Structures에 대해 자세히 알아보기

태그

질문:

2012년 11월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by