The product of a vector and a matrix
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hancheng Zhu
am 8 Dez. 2023
Bearbeitet: Dyuman Joshi
am 8 Dez. 2023
I have a vector A = and a matrix X = , where is a M-dimensional row vector. Does matlab have an operator that directly give me the matrix? (where each row vector in the above matrix X is multiplied by the corresponding part in vector A)
0 Kommentare
Akzeptierte Antwort
Dyuman Joshi
am 8 Dez. 2023
Bearbeitet: Dyuman Joshi
am 8 Dez. 2023
If I understand your question correctly, you should get the desired output using array multiplication -
N=5;
A = (1:N).'
X = magic(N)
Z = A.*X
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrices and Arrays 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!