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

2 ビュー (過去 30 日間)
Prabha Kumaresan
Prabha Kumaresan 2018 年 2 月 5 日
コメント済み: Jan 2018 年 2 月 5 日
Could anyone tell me why NaN is being present instead of numbers.

採用された回答

Birdman
Birdman 2018 年 2 月 5 日
編集済み: Birdman 2018 年 2 月 5 日
  3 件のコメント
Birdman
Birdman 2018 年 2 月 5 日
編集済み: Birdman 2018 年 2 月 5 日
I can if you share your code. You may use isnan.
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 Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by