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!