%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Master Pro II SNM
% 2006 / 2007
%
%Calcul de valeurs propres par la méthode de Jacobi
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear all
n=50;
h=1/(n+1);
niter=600;
eps=0.000001;
A=gallery('toeppd',n);%gallery('tridiag',n)/h^2;
%A=gallery('poisson',10);
D=jacobi(A,niter,eps);
%full(D)
JA=sort(diag(D));
MA=sort(eigs(A,n));
figure(1)
plot(1:n,JA,'+',1:n,MA,'d')
legend('Jacobi','Matlab',-1)
figure(2)
mesh(D)
