How do i concatanate this two matrices even if they are not consistent .
조회 수: 2 (최근 30일)
이전 댓글 표시
A=[0 4 2;10 -2 -7;-7 2 3]; B=[-24 10 ];
댓글 수: 0
채택된 답변
Sriram Tadavarty
2020년 4월 4일
Hi Bita,
In general, inorder to concatenate two matrices any of the dimension must be the same. Like if number of rows are same, you can perform column concatenation and vice versa.
In your caae, A is a 3 x 3 matrix, and B is a 1 x 2 matrix. Inorder concatenate the both, you can make them both vectors and perform the concatenation. You can try C = [A(:); B(:)].
This performs the contention of both vectors provided.
Hope this helps.
Regards, Sriram
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!