Dealing with NaN Values

5 次查看(过去 30 天)
Giorgia Fusaroli
Giorgia Fusaroli 2021-9-30
Hi everybody,
i need help because i can't understand why my code's output is a NaN vector.
I have a matrix of data (135000x8) with no NaN elements, i checked by
find (data == NaN)
and the results was an empy matrix.
But the output of
mean (data, 1)
is a vector (1x8) of NaN values.
Someone can help me in understanding why ??
p.s. i run the same code for various different data and for them was ok.
Thank you in advance !

回答(1 个)

Alan Stevens
Alan Stevens 2021-9-30
Try
find(isnan(data))
  2 个评论
Giorgia Fusaroli
Giorgia Fusaroli 2021-9-30
Thank you !!
there are almost 200 isnan.
How can i deal with them ?
Alan Stevens
Alan Stevens 2021-9-30
Depends what you want to do with the data matrix! You might possibly replace them with zeros, say, or some other number that won't affect what you are going to do with data.

请先登录,再进行评论。

类别

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

标签

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by