How to create a simple matrix from two different kind of matrix size ?
1 回表示 (過去 30 日間)
古いコメントを表示
I have a matrix whose size is 2X5X2 double and another matrix whose size is 2X5 double how i can create a matrix from it where there will be two rows and 15 column total ?
0 件のコメント
採用された回答
Bruno Luong
2022 年 7 月 10 日
M1 = rand(2,5,2) ;
M2 = rand(2,5) ;
reshape(cat(3,M1,M2),size(M1,1),[])
0 件のコメント
その他の回答 (2 件)
Abderrahim. B
2022 年 7 月 10 日
Hi !
Try this:
M1 = rand(2,5,2) ;
M2 = rand(2,5) ;
M = [M1(:,:,1) M1(:,:,2) M2] ;
size(M)
Maybe there is a better way to do this.
HTH
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!