A way to compute dot product of an array and a vector
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Elina Park
am 26 Sep. 2018
Bearbeitet: Torsten
am 8 Jul. 2023
Hi, So if I have a 2-D array such as
[1 2
3 4
5 6]
and a vector such as
[7 8]
I want to have matlab calculate the dot product of the rows of the array and the vector, and save the results as a column vector. How can I do this?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 26 Sep. 2018
[1 2
3 4
5 6] * [7 8].'
2 Kommentare
Francesco Bernardini
am 8 Jul. 2023
Hi, thank you for the answer, it solved my problem;
however, is the dot before the ' needed?
Usually it means elementwise-operation but here I don't see the connection with the transposition;
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!