Finite difference problem showing NaN value

1 visualización (últimos 30 días)
Kevin Isakayoga
Kevin Isakayoga el 25 de Sept. de 2020
Editada: Kevin Isakayoga el 19 de Oct. de 2020
closed

Respuesta aceptada

Dana
Dana el 25 de Sept. de 2020
Editada: Dana el 25 de Sept. de 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.

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by