matrix multiplication error

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 个评论

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?

请先登录,再进行评论。

 采纳的回答

Walter Roberson
Walter Roberson 2012-3-7

0 个投票

You could get NaN if you multiply infinity by 0. Once you have one NaN, it very often "pollutes" all the other calculations.

3 个评论

i'm guessing probably i am not suppose to have infinity but my matrix is 24x2100 size so should i check all elements by one by if it they are infinity or not?
is there any other easy way to do that?
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.
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

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by