I am trying to use ode45(...) function to approximate the solution to the differential equation. Moreover, I am trying to do it with different spans by using different step sizes in the span.
So, I am changing the parameter dt:
tspan = 0:dt:1;
ode_func = @(t, x, flag) 1 - x + t;
[~, sol] = ode45(ode_func, tspan, x0);
Where dt takes values from `[0.001:0.001:0.01 0.02:0.01:0.1 0.1:0.1:0.5 1.0].
The problem is that, when I take the dt=1.0. The tspan is then just [0 1], and the ode45() funcion takes it as just start and end points of the range (and calculates the span of 41 values instead of using just these 2 values).
How to force ode45 to use JUST THESE values? I understand that it doesn't make much sense, but I want to plot a graph of dependency of the errors on that step size.