%EX_6_1 generates a phase portrait of Example 6.1 interactively

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

clear
tspan=[0 20];
x0=[-.1 .1]';
button=1;
% set axis and draw internal axes
axis([-5 5 -10 10])
hold on
plot([-5 5],[0 0])
plot([0 0],[-10 10])
xlabel('{\it{x}}_1','Fontsize',12)
ylabel('{\it{x}}_2','Fontsize',12)
title('Interactive phase portrait of Example 6.1','Fontsize',12)
set(gca,'Fontsize',12)
    while(button==1)
       [t,x]=ode23s('vss_eu1',tspan,x0);
      plot(x(:,1),x(:,2))
      [x1,x2,button]=ginput(1);
      x0=[x1 x2]';
    end