
%Input matrix from example:
A = [6,5;1,2]; 

%Number of iterations:
N=20;

%Find dimension to make method general:
[n,~]=size(A); 

%Startvector:
x=[0;1]; %From example
%x=rand(n,1);%Or random
[muAbs,i]=max(abs(x));
mu = x(i);

for k=1:N
   disp(['Step ',num2str(k)])
   x=A*x;
   [muAbs,i]=max(abs(x));
   mu = x(i)
   x = x/mu
end
