clear, set(0,'DefaultFigureWindowStyle','docked') x0 = 1e-2; T = 1; lambda = 500; f =@(t,y) lambda*y.^2.*(1-y); opts = odeset('reltol', 1e-8, 'abstol', 1e-8); [t, z] = ode45(f, [0, T], x0, opts); figure; subplot(2,1,1), plot(t,z(:,1)); title('ode45') subplot(2,1,2), semilogy(t(2:end), diff(t)); title('stepsize') pause opts = odeset('reltol', 1e-8, 'abstol', 1e-8); [t, z] = ode23s(f, [0, T], x0, opts); figure; subplot(2,1,1), plot(t,z(:,1)); title('ode23s') subplot(2,1,2), semilogy(t(2:end), diff(t)); title('stepsize')