% Numerical Mathematics and Computing, Fifth Edition % Ward Cheney & David Kincaid % Brooks/Cole Publ. Co. % (c) 2003 % % file: shift_inverse_power.m % shifted inverse LU decomposition of the matrix A, where the matrix P is % a permutation matrix corresponding to the pivoting strategy % used. A = [1 3 7; 2 -4 5; 3 4 -6] B = A+6*eye(3) C = inv(B) x = [1; 1; 1] for k=1:30 y = C*x; r = y(2)/x(2) x = y/norm(y) end