Multiplying 2 matrices together
显示 更早的评论
I'm trying to multiply 2 matrices together. One has dimensions 50x41472 and the other has dimensions 41472x50.
I know that for multiplication to work, the inner numbers must be the same, which they are since 41472=41472.....
Also the resulting matrix will have dimensions of the outer numbers, 50x50 which is the order of the matrix that I need
for what I'm doing. However, when I try and do this calculation in matlab, I get the error message "Matrix dimensions
must agree", which doesn't make any sense because they do agree... is the problem that matlab just can't handle an
operation of this size? How can I fix this? Thanks for any help!
This is the exact code I have; the matrices V_row and V_col are already defined in my kernel, so that is not the problem.
V = V_row.*V_col
回答(1 个)
James Tursa
2020-4-8
编辑:James Tursa
2020-4-8
Use the matrix multiply operator * without the dot. What you are using is the element-wise multiply operator .* with the dot. Two different operators.
V = V_row*V_col
类别
在 帮助中心 和 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!