dot product between two different size of matrix
63 次查看(过去 30 天)
显示 更早的评论
Hello,
I have two matrix, one is A (1by 3 matrix), the other one is B (86 by 3 matrix). And I would like to calculate the dot product of dot(A,B). However, A and B are not the same size, so dot(A,B) function can not be performed successfullly.
How can I calculate the dot product between two different size of matrix without using for loop?
Many thanks!
0 个评论
采纳的回答
更多回答(1 个)
James Tursa
2020-12-18
Assuming everything is real and by "dot product" you aren't involving complex conjugates, simply this
C = B * A';
3 个评论
James Tursa
2021-12-14
@Prajwal Sridhar Try it and see if it does what you want. If it doesn't, then open up a new Question and post a small example of inputs and desired output.
另请参阅
类别
在 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!