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 SolutionsMATLAB: Solve two ODE with IVP euler Hi @shubham kumar guptaThis is one of several ways to simulate the time-varying dynamics.tspan = 0:0.0001:1; % simulation time and step sizey0 = [1; 2]; % initial condition[t, y] = ode45(@(t,y) [t*y(1) + y(2); 2*y(1) - t*y(2)], tspan, y0);plot(t, y) Related Question
Best Answer