close all s=1;rho=0.1; x1_0=.1; x2_0=-1; sim('model_ex6',10); tnew=0:.01:10; xnew=sample(x,tout,tnew); figure(2) subplot(211) plot(tout,x(:,1)); hold on plot(tnew,xnew(:,3),'.'); subplot(212) plot(tout,x(:,2)); hold on plot(tnew,xnew(:,4),'.'); rho=0.01; sim('model_ex6',10); xnew=sample(x,tout,tnew); subplot(211) plot(tout,x(:,3),'r--'); axis([0 1 -.6 .2]); xlabel('t'); ylabel('x_1(t)'); subplot(212) plot(tout,x(:,4),'r--'); axis([0 1 -3 6]); xlabel('t'); ylabel('x_2(t)'); figure(1) plot(x(:,1),x(:,2)); hold on s=0; rho=.01; sim('model_ex6',10); xnew=sample(x,tout,tnew); plot(xnew(:,1),xnew(:,2),'g--'); rho=0.005; sim('model_ex6',10); xnew=sample(x,tout,tnew); plot(xnew(:,1),xnew(:,2),'c-.'); rho=0.004; sim('model_ex6',10); plot(x(:,1),x(:,2),'r'); xlabel('x_1') ylabel('x_2') % legend('state feedback','\rho=0.01','\rho=0.05','\rho=0.004')