Could anyone tell me why NaN is being present instead of numbers.

2 次查看(过去 30 天)
Could anyone tell me why NaN is being present instead of numbers.

采纳的回答

Birdman
Birdman 2018-2-5
编辑:Birdman 2018-2-5
  3 个评论
Jan
Jan 2018-2-5
@Prabha: To avoid the creation of NaN value, you have to avoid to perform calculations, which have NaN as result. There is no general way to "avoid" them, because they are the mathematically correct result for certain operations.
You get e.g. NaN for the numerical value of an imported Excel file, if the corresponding cell contains a string. Or you get NaN, if you divide by 0. If you need a method to catch this, post the relevant part of your code, as usual.

请先登录,再进行评论。

更多回答(0 个)

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by