Dot Product of Rows in array

5 次查看(过去 30 天)
Ahmed Abdulla
Ahmed Abdulla 2022-6-21
回答: KSSV 2022-6-21
I have two arrays, A of size 1000x2 and B of size 1000x2. I would like to get dot product of the each set of rows so that the result is an array of size 1000x1 with the results. Without using a for loop

回答(1 个)

KSSV
KSSV 2022-6-21
iwant = sum(A.*B,2) ;

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

产品


版本

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by