i have 3 matrices the first one is 3x3 the second is 1x3 the third is 3x2 and i want to build new matrix using the 1st raw of the 1st and the second row of 2nd he 2nd
조회 수: 6 (최근 30일)
이전 댓글 표시
a = [1 2 3 ;
4 5 6 ;
7 8 9]
b = [7 5 6]
c = [19 23;
31 29;
17 13]
댓글 수: 3
답변 (1개)
William Rose
2022년 4월 17일
You wrote: "i have 3 matrices the first one is 3x3 the second is 1x3 the third is 3x2 and i want to build new matrix using the 1st raw of the 1st and the second row of 2nd he 2nd"
However, the 2nd matrix only has 1 row, so I will assume you meant to write:
"using the first row of a, all of matrix b, and the second column of matrix c as the thrid row of the new matrix"
The code below shows how to do it. Adjust as desired to meet your actual wishes.
a = [1 2 3 ; 4 5 6 ; 7 8 9];
b = [7 5 6];
c = [19 23; 31 29; 17 13];
d=[a(1,:); b; c(:,2)']
Try the above.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Assembly에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!