MATLAB Answers

Finite difference problem showing NaN value

1 view (last 30 days)

Accepted Answer

Dana on 25 Sep 2020
Edited: Dana on 25 Sep 2020
When M>=2, in the last line of your code,
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.


Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by