Vector and matrices dotwise multiplication
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a n elements vector a1 a2 ... an
and n same-sized matrices b1 b2 ... bn
how can I do a1*b1 + a2*b2 + ... + an*bn without loop? I was thinking if there's a way to do something like multidimentsional array dotwise multiplication? Thanks.
0 Kommentare
Antworten (1)
per isakson
am 8 Apr. 2013
Try
a * transpose( b )
where
a = [ a1, a2, ... an ]
b = [ b1, b2, ... bn ]
1 Kommentar
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!