How to create a simple matrix from two different kind of matrix size ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Akash Pal
am 10 Jul. 2022
Beantwortet: Dhritishman
am 10 Jul. 2022
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 Kommentare
Akzeptierte Antwort
Bruno Luong
am 10 Jul. 2022
M1 = rand(2,5,2) ;
M2 = rand(2,5) ;
reshape(cat(3,M1,M2),size(M1,1),[])
0 Kommentare
Weitere Antworten (2)
Abderrahim. B
am 10 Jul. 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
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!