% QUIVER(X,Y,U,V) plots velocity vectors as arrows with
% components (u,v) at the points (x,y).
% [x, y]= meshgrid(-1:0.1:1, -1:0.1:1);
% px=-x+3*y;
% py=-2*y;
% quiver(x,y,px,py);
% % And trajectory starting from (x10, x20)
% t=0:0.1:10; x10=1; x20=1;
% plot(x10*exp(-t)+x20*3*(exp(-t)-exp(-2*t)),x20*exp(-2*t),'go-');
% %
[x, y]= meshgrid(-1:0.1:1, -1:0.1:1);
px=-x+3*y;
py=-2*y;
quiver(x,y,px,py);
hold on;
% [T,Y] = solver(odefun,tspan,y0) integrates the system of
% differential equations for tspan=[t0 tf] with initial
% conditions y0
[t,xx]=ode45(@func_d,[0 10],[1;1]);
plot(xx(:,1),xx(:,2),'go-');

% function definition
%function dx = func_d(t, x)
%dx = [-x(1)+3*x(2); -2*x(2)];
%end
