% Experimenting with 3x3 matrices and the power method
%
% Samuli Siltanen November 2012

B = [...
    [1 2 3];...
    [5 5 5];...
    [5 3 2]];

[V,D] = eig(B)

% Choose a vector
x_current = [10;9;-exp(1)];

% Iterate
for iii = 1:15
    x_old     = x_current;
    x_current = B*x_old;
    
    disp([x_current(1)/x_old(1),x_current(2)/x_old(2),x_current(3)/x_old(3),])
    pause
end


