Suppose I have a 2 by 60 matrix, like A = [1:60,2:61] how can I reshape it by the first 10 rows so that I can get a 20 by 6 matrix??

1 回表示 (過去 30 日間)
B = reshape(A,rowSize(A)/6,[],6)

採用された回答

Chetan Bhavsar
Chetan Bhavsar 2021 年 10 月 12 日
A = [1:60;2:61]
A = 2×60
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 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
B = reshape(A,[20,6])
B = 20×6
1 11 21 31 41 51 2 12 22 32 42 52 2 12 22 32 42 52 3 13 23 33 43 53 3 13 23 33 43 53 4 14 24 34 44 54 4 14 24 34 44 54 5 15 25 35 45 55 5 15 25 35 45 55 6 16 26 36 46 56

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by