// Diagrama de fase
A = [2 1;2 -1]
deff('f = ej3s(x)','f = A*x')
x0 = [1;1]
xs = fsolve(x0,ej3s)

deff('xprima = ej3(t,x)','xprima = A*x') 
clf
xf = linspace(-8,8,8);yf = linspace(-8,8,6)
fchamp(ej3,0,xf,yf)
xlabel('x1');ylabel('x2')

[R,diagevals] = spec(A)
pend1 = R(2,1)/R(1,1);y1 = xs(2) + pend1*(xf-xs(1))
pend2 = R(2,2)/R(1,2);y2 = xs(2) + pend2*(xf-xs(1))
plot2d(xf',[y1' y2'],rect=[-8 -8 8 8]);plot2d(xs(1),xs(2),-5)

t = 0:0.1:10
for i = 1:16
[b,x10,x20] = xclick()
       x = ode([x10;x20],0,t,ej3)
    plot2d(x(1,:),x(2,:),rect = [-8 -8 8 8])
 end
