Multiplying 2 matrices together
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
James Tursa
el 8 de Abr. de 2020
Editada: James Tursa
el 8 de Abr. de 2020
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 comentarios
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!