//Eigenvalue sensitivity example. See section 8 of the Users' Guide. B = <3 0 7; 0 2 0; 0 0 1> L = <1 0 0; 2 1 0; -3 4 1>, M = L\L' A = M*B/M A = round(A) <X,D> = eig(A) long, diag(D), short cond(X) X = X/diag(X(3,:)), cond(X) Y = inv(X'), Y'*A*X for j = 1:3, c(j) = norm(Y(:,j))*norm(X(:,j)); C E = -1.e-6*Y(:,1)*X(:,1)' eig(A + .4*E), eig(A + .5*E) r = .4; s = .5; while s-r > 1.e-14, t = (r+s)/2; d = eig(A+t*E); ... if imag(d(1))=0, r = t; else, s = t; long, t = r A+t*e, eig(A+t*E) <X,D> = eig(A+t*E); X = X/diag(X(3,:)) short, cond(X)