function [R]=hessen1(A)
% Hessenberg Reduction by using Givens Method
n=size(A);
G=eye(size(A)); %Gives rotation matrix accumulator
R=A; %Copy A into R 
for j=1:n-2 %Outer loop (determines columns being zeroed out)
    for i=n:-1:j+2 %Inner loop (successively zeroes jth column)
        giv=givens(R(j:n, j:n), i-j+1, i-j);
        giv=blkdiag(eye(j-1), giv); %Resize rotator to full size
        G=giv*G; %Accumulate G which give a Q in the end
        %Perform similarity transform
        R=giv'*R;
        R=R*giv;
    end
    figure; matrixplot(R);
end
end