MATLAB: Tspan is not strictly increasing.

ode45

I am trying to solve a second order ode using ODE45 but my tspan is not strictly increasing. How can I solve it ?

Best Answer

Since ode45 uses an automated stepwide control just define the start and the end of your tspan this way:
tspan = [0 10];
This is all you have to do to solve this problem.
Related Question