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 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
a = [1 2 3 ;
4 5 6 ;
7 8 9]
b = [7 5 6]
c = [19 23;
31 29;
17 13]
3 commentaires
Réponses (1)
William Rose
le 17 Avr 2022
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 commentaires
Voir également
Catégories
En savoir plus sur Assembly dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!