comparison toolbox/eigsens.m @ 0:8f23314345f4 draft

Create local repository for matrix toolboxes. Step #0 done.
author Antonio Pino Robles <data.script93@gmail.com>
date Wed, 06 May 2015 14:56:53 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:8f23314345f4
1 function [X, D, s] = eigsens(A)
2 %EIGSENS Eigenvalue condition numbers.
3 % EIGSENS(A) is a vector of condition numbers for the eigenvalues
4 % of A (reciprocals of the Wilkinson s(lambda) numbers).
5 % These condition numbers are the reciprocals of the cosines of the
6 % angles between the left and right eigenvectors.
7 % [V, D, s] = EIGSENS(A) is equivalent to
8 % [V, D] = EIG(A); s = EIGSENS(A);
9
10 % Reference:
11 % G.H. Golub and C.F. Van Loan, Matrix Computations, Second
12 % Edition, Johns Hopkins University Press, Baltimore, Maryland,
13 % 1989, sec. 7.2.2.
14
15 n = max(size(A));
16 s = zeros(n,1);
17
18 [X, D] = eig(A);
19 Y = inv(X);
20
21 for i=1:n
22 s(i) = norm(Y(i,:)) * norm(X(:,i)) / abs( Y(i,:)*X(:,i) );
23 end
24
25 if nargout <= 1, X = s; end