%Oppgave 2 c)
K=[3,0,1;1,3,2;0,1,-1];
 [P, D]=eig(K) 
  %En diagonalisering er P * D * P^-1

  %Oppgave 2 c)
K=[3,0,1;0,3,0;0,1,-1];
 [P, D]=eig(K) 
  
% Oppgave 2 d)
Z=zeros(5);

for i=1:5
    for j=1:5
        Z(i,j)= 1/(i+j) ; %Setter element (i,j) lik 1/(i+j)
    end
end

Z

[P, D]=eig(Z)

 
% LL = [ 7 , 9; 4 , 2 ] matrisen i del a)
     %[aa, bb]=eig(LL);  
     
     
  %L= [0,1,-1;1,-1, -1; -1,-1,-1 ];
%[aa, bb]=eig(L);