Finite difference problem showing NaN value

1 vue (au cours des 30 derniers jours)
Kevin Isakayoga
Kevin Isakayoga le 25 Sep 2020
closed

Réponse acceptée

Dana
Dana le 25 Sep 2020
Modifié(e) : Dana le 25 Sep 2020
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.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by