How to create a simple matrix from two different kind of matrix size ?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Bruno Luong
il 10 Lug 2022
M1 = rand(2,5,2) ;
M2 = rand(2,5) ;
reshape(cat(3,M1,M2),size(M1,1),[])
0 Commenti
Più risposte (2)
Abderrahim. B
il 10 Lug 2022
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
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!