function Ad = QRsval(A,k)
% Applies k iterations of the QR algorithm 
% to compute the singular values of A


for j = 1:k
   [Q,R] = qr(A'*A); 
   [P,S] = qr(A*A');
   A = P'*A*Q;
end

Ad = A;

return;

