% m10_QRfact.m - QR factorisation A = zeros(7,3) A(:) = (1:21).^2 [Q,R] = qr(A,0) norm(A(:,1)) norm(A(:,2)) norm(R(:,2)) Q'*Q Q*Q' rank(ans) A = randn(1e4,1e3); tic, [Q,R] = qr(A,0); toc max(max(abs( Q'*Q - eye(1e3) )))