Reshape array to specified matrix format

4 ビュー (過去 30 日間)
Ahmet Hakan UYANIK
Ahmet Hakan UYANIK 2020 年 5 月 4 日
編集済み: David Hill 2020 年 5 月 4 日
Hello everyone,
I have searched forums and I could not find a suitable solution so I come here to post my question. I have a 1x15770 array. I would like to turn this into 415x38 column. Therefore shifting or moving every 38 data inputs into a new row. Here is a smaller example of what I am trying to accomplish.
A=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]
Given matrix A should cut regularly like given matrix B. This is what I want to see
B =
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
reshape command separates matrix(A) like this and I dont want to retake matrix(C)
C= 1 4 7 10 13
2 5 8 11 14
3 6 9 12 15
Any advice on how to do this would be greatly helpful to me.

採用された回答

David Hill
David Hill 2020 年 5 月 4 日
編集済み: David Hill 2020 年 5 月 4 日
reshape(A,38,415)';

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by