Hi everybody, I have an array like this:
1 2 3 4 5 6 7 8
9 10 11 12 13 14 15 16
17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32
how can i permute the array in another like this?:
1 2 3 4
9 10 11 12
17 18 19 20
25 26 27 28
5 6 7 8
13 14 15 16
21 22 23 24
29 30 31 32
Thank you so much!

 채택된 답변

Omer Yasin Birey
Omer Yasin Birey 2019년 1월 29일
편집: Omer Yasin Birey 2019년 1월 29일

0 개 추천

a = [1 2 3 4 5 6 7 8;...
9 10 11 12 13 14 15 16;...
17 18 19 20 21 22 23 24;...
25 26 27 28 29 30 31 32];
a = [a(:,1:end/2);a(:,end/2+1:end)]

추가 답변 (1개)

KSSV
KSSV 2019년 1월 29일

1 개 추천

A = [1 2 3 4 5 6 7 8
9 10 11 12 13 14 15 16
17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32];
C = [A(:,1:4) ; A(:,5:end)] ;

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

제품

릴리스

R2018b

태그

질문:

2019년 1월 29일

답변:

2019년 1월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by