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

조회 수: 7 (최근 30일)
Sunil Kunjachan
Sunil Kunjachan 2016년 12월 17일
편집: Jan 2016년 12월 17일
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