Dealing with NaN Values

조회 수: 1(최근 30일)
Giorgia Fusaroli
Giorgia Fusaroli 2021년 9월 30일
댓글: Alan Stevens 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
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.

댓글을 달려면 로그인하십시오.

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by