How to know if a matrix has nan?

1 vue (au cours des 30 derniers jours)
JFz
JFz le 5 Déc 2016
Commenté : Star Strider le 5 Déc 2016
Hi,
I have a huge matrix or table with doubles. But there might be nan in it. How do I know if there are any nan in it? I know I can use ismissing TF = ismissing(A); But TF is a huge matrix with many 0's in it. I am not sure if there are any 1's.
Thanks!

Réponse acceptée

Star Strider
Star Strider le 5 Déc 2016
To find the number of NaN values, I would do this:
NrNaN = sum(isnan(A(:)));
  2 commentaires
JFz
JFz le 5 Déc 2016
Thank you so much for this quick help! This is what I was looking for.
Star Strider
Star Strider le 5 Déc 2016
As always, my pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by