%EX_6_2 generates a phase portrait of Example 6.2 interactively

% last modified by S. H. Zak on Decemebr 2, 2002

clear
tspan=[0 10];
x0=[-1 -1]';
button=1;
axis([-2 2 -2 2])
hold on
grid
xlabel('{\it{x}}_1','Fontsize',12)
ylabel('{\it{x}}_2','Fontsize',12)
title('Interactive phase portrait of Example 6.2','Fontsize',12)
set(gca,'Fontsize',12)
    while(button==1)
       [t,x]=ode45('vss_eu2',tspan,x0);
      plot(x(:,1),x(:,2))
      [x1,x2,button]=ginput(1);
      x0=[x1 x2]';
    end