% script comparison between householder and modified gram-schmidt 
% for a square matrix
a=zeros(1:200,1);b=zeros(1:200,1);
for i=100:200
   A=hilb(i);
   [Q,R,a(i)]=mgs(A);
   [Q1,R1,b(i)]=house(A);
   disp(sprintf('%6.0f  %6.0f  ',a(i),b(i)))
end
figure
hold on
semilogy(100:200,(a(100:200)))
semilogy(100:200,(b(100:200)))
hold off