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
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)']
d = 3×3
1 2 3 7 5 6 23 29 13
Try the above.

카테고리

Help CenterFile Exchange에서 Assembly에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by