reshapeで空欄を詰めない方法
Afficher commentaires plus anciens
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で固定して、もとの行列の要素が混ざらないようにしたいです。
どのようなコードを書けばよいでしょうか。
よろしくお願いいたします。
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Resizing and Reshaping Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!