行列を連結して新たな行列を作る方法
Afficher commentaires plus anciens
サイズM×Nの行列AとサイズM×N行列Bからサイズ2M×Nの行列Cを作りたいです。
たたし行列Aの下にそのまま行列Bを連結するのではなく
行列Cの各要素が
「A(1,1:end); B(1,1:end); A(2,1:end); B(2,1:end); ....... A(M,1:end); B(M,1:end)]
になるようにfor文などでループをまわしたいのですがどう書けばいいですか。(Mがかなり大きいため)
例えば,
3×3サイズの行列A=[1 2 3; 7 8 9; 13 14 15]、 行列B=[4 5 6; 10 11 12; 16 17 18]から
6×3の行列C=[1 2 3; 4 5 6; 7 8 9; 10 11 12; 13 14 15;16 17 18]を作るといったようにしたいです。
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating and Concatenating 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!