i have two different array holding some numbers, e.g; i have an array P containing 5 elements and other Q containing 6 elements. I want to find out P*Q matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Ashish Verma
am 14 Okt. 2021
Bearbeitet: John D'Errico
am 14 Okt. 2021
Eg;
P= [1 2 3 4 5 ];
Q=[8 9 5 7 3 4];
output like
1 2 3 4 5
8 1*8 2*8 3*8 4*8 5*8
9 1*9 2*9 .....................5*9
5 1*5 2*5 ......................5*5
7 1*7 2*7 .....................5*7
3 1*3 .................................3*5
4 1*4..................................5*4
0 Kommentare
Akzeptierte Antwort
Mathieu NOE
am 14 Okt. 2021
P= [1 2 3 4 5 ];
Q=[8 9 5 7 3 4];
T = (P'*Q)'
3 Kommentare
John D'Errico
am 14 Okt. 2021
Bearbeitet: John D'Errico
am 14 Okt. 2021
Or, simpler yet, since (A * B)' = B' * A
T = Q' * P;
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!