Reshape an array into another

2 ビュー (過去 30 日間)
Riccardo Rossi
Riccardo Rossi 2019 年 1 月 29 日
回答済み: KSSV 2019 年 1 月 29 日
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 日
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 日
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)] ;

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by