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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by