Vector and matrices dotwise multiplication
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
per isakson
2013 年 4 月 8 日
Try
a * transpose( b )
where
a = [ a1, a2, ... an ]
b = [ b1, b2, ... bn ]
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!