matrix multiplication error
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Fred
el 7 de Mzo. de 2012
Comentada: Imola Fodor
el 6 de Ag. de 2021
Hi all,
i'm doing matrix multiply and array multiply but it gives me NaN matrix what can be the reason for that? this is the equation a=xv*eye(n).*xv
thanks in advance.
1 comentario
ferda sonmez
el 21 de Mzo. de 2019
Hi,
I have thw saame issue. My matrixes do not have NaN values, however, multiplication of the matrixes has NaN values? Is this situation is acceptable or am I missing something?
Respuesta aceptada
Walter Roberson
el 7 de Mzo. de 2012
You could get NaN if you multiply infinity by 0. Once you have one NaN, it very often "pollutes" all the other calculations.
3 comentarios
Walter Roberson
el 7 de Mzo. de 2012
any(isfinite(Matrix(:)))
will be true if there are any infinite values.
Be sure to also check
any(isnan(Matrix(:)))
which will be true if there are any NaN values.
Imola Fodor
el 6 de Ag. de 2021
hi, I dont have infinite values - checked with any(isinf(Matrix(:))).. no Nan-s either, the columns/rows match, and i get Nan-s on the output..any firther suggestion? thank you
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical 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!