Finite difference problem showing NaN value

조회 수: 1 (최근 30일)
Kevin Isakayoga
Kevin Isakayoga 2020년 9월 25일
편집: Kevin Isakayoga 2020년 10월 19일
closed

채택된 답변

Dana
Dana 2020년 9월 25일
편집: Dana 2020년 9월 25일
When M>=2, in the last line of your code,
Rt_inc(M+1)=(v-1)*(rt_inc(M)^2)*((rt_inc(M+1)-rt_inc(M))/dt)/Sr(M);
because rt_inc(M+1)-rt_inc(M)=0 and Sr(M)=0, this becomes 0/0, which is not defined and produces a NaN in Matlab.

추가 답변 (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