How to know if a matrix has nan?

1 次查看(过去 30 天)
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!

采纳的回答

Star Strider
Star Strider 2016-12-5
To find the number of NaN values, I would do this:
NrNaN = sum(isnan(A(:)));
  2 个评论
JFz
JFz 2016-12-5
Thank you so much for this quick help! This is what I was looking for.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by