What should I do for NaN values?

2 visualizaciones (últimos 30 días)
Sukru Yavuz
Sukru Yavuz el 13 de Mzo. de 2018
Comentada: Stephen23 el 13 de Mzo. de 2018
I have an 1x507 array with NaN values and I am using this array for another calculation. That's why I think these are effecting my calculation. What should I do about them? Should they stay as they are or I should do something?
  3 comentarios
Sukru Yavuz
Sukru Yavuz el 13 de Mzo. de 2018
Editada: Sukru Yavuz el 13 de Mzo. de 2018
I need them for my calculation. I don't need to count them. I need to calculate the sums of all 507 columns and save them as a table. Which is again equal to NaN. I think the numbers are very very very lower than zero that's why they are NaN.
likelihood(nn) = multiplycolumns(nn) * bolumler{nn}; (After this step the array has multiple NaN and Inf.) likelihoodsums = sum(likelihood)
Stephen23
Stephen23 el 13 de Mzo. de 2018
"What should I do about them? Should they stay as they are or I should do something?"
Why do you assume that you have to "do something" about them? NaN values are there for a reason, and it is usually a bad strategy to turn NaN values into some fake data values (e.g. 0): that would probably distort your calculations even more.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by