reshapeで空欄を詰めない方法
Show older comments
reshape関数を使って行列変換をしたいです。
データが膨大なので簡単な数字で代用すると、
1 3 2 1 3 2 3 4
2 2 4 2 1 5 3 2
2 3 4 5 6 5 3 4
という3×8の行列を
1 3 2
1 3 2
3 4
2 2 4
2 1 5
3 2
2 3 4
5 6 5
3 4
のように列数を3で固定して、もとの行列の要素が混ざらないようにしたいです。
どのようなコードを書けばよいでしょうか。
よろしくお願いいたします。
Accepted Answer
More Answers (0)
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!