% Tracking Example 1 global f11 f12; f11 = 24; %f11 = 0; x0=[1;0]; x0=[2;0]; t0=0; tf=4; options=odeset('RelTol',1e-8,'AbsTol',1e-10'); figure(1); clf; hold on; f12 = -2; [Ta,Xa]=ode45('track1', [t0 tf], x0,options); plot(Xa(:,1),Xa(:,2),'.g'); f12 = -5; [Tb,Xb]=ode45('track1', [t0 tf], x0,options); plot(Xb(:,1),Xb(:,2),'.r'); f12 = -10; [Tc,Xc]=ode45('track1', [t0 tf], x0,options); plot(Xc(:,1),Xc(:,2),'.b'); f12 = -30; [Td,Xd]=ode45('track1', [t0 tf], x0,options); plot(Xd(:,1),Xd(:,2),'.m'); grid; figure(2); clf; hold on; plot(Ta,exp(-Ta),'.c'); plot(Ta,Xa(:,1),'.g'); plot(Tb,Xb(:,1),'.r'); plot(Tc,Xc(:,1),'.b'); plot(Td,Xd(:,1),'.m');