MATLAB Answers


How do I best determine if something is "NaN"?

Asked by Arielle
on 15 May 2013
I am calculating the ILU factorization of a matrix (repeatedly over a large number of iterations) and at some point norm(U\(L\A)-eye(n),'fro') evaluates to "NaN" (and therefore GMRES does not work). I would like to catch the code immediately before it calls GMRES when this occurs. What is the best way to ask Matlab to stop when norm(U\(L\A)-eye(n),'fro') is NaN?


Sign in to comment.

1 Answer

Answer by Dr. Seis
on 15 May 2013
 Accepted Answer

See documentation for isnan

  1 Comment

Excellent. Thank you.

Sign in to comment.