필터 지우기
필터 지우기

returning "NaN" as results

조회 수: 21 (최근 30일)
ZhenQi
ZhenQi 2013년 1월 15일
Help!! I'm writing a code for Gauss Elimination Method, but my array of returned x(i) gives the result:
ans =
NaN
NaN
NaN
NaN
NaN
I looked online but still can't find any useful solutions, does someone know any quick way of fixing this?

답변 (1개)

Walter Roberson
Walter Roberson 2013년 1월 15일
There is no quick way. You have an error at some unknown point in your code. You need to re-examine your code and debug it.
NaN would be produced if you had 0/0 or inf*0
I suggest that at the command prompt you type
dbstop if naninf
and run again. It will stop at the point the first NaN or Infinity is produced.

카테고리

Help CenterFile Exchange에서 Function Creation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by