A way to compute dot product of an array and a vector
조회 수: 18 (최근 30일)
이전 댓글 표시
Hi, So if I have a 2-D array such as
[1 2
3 4
5 6]
and a vector such as
[7 8]
I want to have matlab calculate the dot product of the rows of the array and the vector, and save the results as a column vector. How can I do this?
댓글 수: 0
채택된 답변
Walter Roberson
2018년 9월 26일
[1 2
3 4
5 6] * [7 8].'
댓글 수: 2
Francesco Bernardini
2023년 7월 8일
Hi, thank you for the answer, it solved my problem;
however, is the dot before the ' needed?
Usually it means elementwise-operation but here I don't see the connection with the transposition;
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!