extract a double array to multiple arrays

I have a double array
aa = [1, 2, 3, 4, 11,12, 13, 14, 21, 22, 23, 24]
How can I get 3 arrays
b1 = [1, 11, 21]
b2 = [2, 12, 22]
b3 = [3, 13, 23]
b4 = [4, 14, 24]
Thanks!

1 件のコメント

Shannon
Shannon 2020 年 1 月 11 日
Well, I think I can reshape this.
Thanks

サインインしてコメントする。

 採用された回答

Vladimir Sovkov
Vladimir Sovkov 2020 年 1 月 11 日

1 投票

b1=aa(1:4:end);
b2=aa(2:4:end);
b3=aa(3:4:end);
b4=aa(4:4:end);

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

質問済み:

2020 年 1 月 11 日

回答済み:

2020 年 1 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by