MATLAB: Solving differential equation with ode45

ode45

Best Answer

func=@(t,y)(y-1)^2;
tspan = [0 10];
for x = 0.01:0.05:1
y0 = x;
[t,y] = ode45(func,tspan,y0);
plot(t, y(:,1));
hold on
end
Related Question