필터 지우기
필터 지우기

How can i solve the Nan error ?

조회 수: 9 (최근 30일)
rakshanda showkat
rakshanda showkat 2021년 1월 21일
댓글: Bram Schroeders 2021년 1월 21일
Dear all,
I am getting NaN results for the Dep matrix as i run the whole code. After i put break point on that line, the expressions in the Dep matrix show their correct value.
As i remove breakpoint and run the whole code, Nan values occur in the terms of Dep matrix.
I have attached the MATLAB file.
Any help would be highly appreciated.
  댓글 수: 3
rakshanda showkat
rakshanda showkat 2021년 1월 21일
thank you sir for reply.
But how does this Aphi value turn to zero on every iteration?
Any help?
Bram Schroeders
Bram Schroeders 2021년 1월 21일
It doesn't turn zero on every iteration. On line 48 you declare Aphi as an zero array with as many rows as iterations.
Then on line 78 you calculate Aphi(1) with an equation.
Then on line 95 you use Aphi(i) as the denominator in an equation.
Then on line 114 you calculate Aphi(i) with another equation.
So when the second iteration starts Aphi(2) is still zero when you arive at line 95, since the second value of Aphi is calculated on line 114. So maybe in line 114 it should be i + 1 or something like that?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by