clear all
global A
%
% Example 1
%
A=[[-5 2];[-4 1]];

x1=-1;x2=1;y1=-1;y2=1;
[x,y]=meshgrid(x1:.1:x2,y1:.1:y2);
t=0;
xprime=A(1,1).*x+A(1,2).*y;
yprime=A(2,1).*x+A(2,2).*y;

nxprime=xprime./sqrt(xprime.^2+yprime.^2);
nyprime=yprime./sqrt(xprime.^2+yprime.^2);
quiver(x,y,nxprime,nyprime,.5);

hold on
T=4;
xinit=[[-1;-1] [1;1] [1;2] [-1;-2] [1;-.1] [1;.2] [-1;.2] [-1;-.1] [.8;1] [-.8;-1]];
K=length(xinit(1,:));
for k=1:K
[t,x]=ode23('f',[0, T],xinit(:,k));
hold on
plot(x(:,1),x(:,2),'r-','linewidth',2)
end
axis([-1 1 -1 1])
