f = @(t,y) y.^2 - t; y0 = 1; tspan = [0 1.05]; % tspan = [0 1.5]; opts = odeset('RelTol',1e-12,'AbsTol',1e-14); [t1,y1] = ode45(f,tspan,y0,opts); plot(t1,y1) print -dpng "plot.png"