Multiplying 2 matrices together
3 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (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
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Operators and Elementary Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!