Suppose I want to run
f = @(t,x) [-x(1)*x(2);x(1)*x(2)-x(2);x(2)][t,xa]=ode45(f,[0 6], [4 0.1 0]);
this runs the system from time 0 to 6. Suppose now I want to
*run the system from time 0 to 2
*from time 2, want to run
f = @(t,x) [-0.5*x(1)*x(2);0.7*x(1)*x(2)-x(2);x(2)]
How can one write a script? Thank you.
Best Answer