How can I multiply two different length vectors using for loops in Matlab ?

15 次查看(过去 30 天)
ie. [1 2 3] and [1 2] The results should be a vector [3 6 9]. That is (1x1)+(1x2)=3, (1x2)+(2x2)=6,(1x3)+(2x3)=9. Appreciate the help

采纳的回答

Jan
Jan 2016-12-17
编辑:Jan 2016-12-17
A = [1 2 3]
B = [1 2]
C = sum(B.' * A, 1)

更多回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by