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

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);

T=4;
xinit=[[1;0] [-1;0] [1;2] [-1;-2] [1;-.1] [1;-.01] [1;.1] [1;.01] [-1;-.1] [-1;-.01] [-1;.1] [-1;.01]];
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])

[t,x]=ode23('f',[0, -T],xinit(:,4));
hold on
plot(x(:,1),x(:,2),'r-','linewidth',2)

[t,x]=ode23('f',[0, -T],xinit(:,3));
hold on
plot(x(:,1),x(:,2),'r-','linewidth',2)