cheub@fmatbpc13:~$ octave GNU Octave, version 3.2.2 Copyright (C) 2009 John W. Eaton and others. This is free software; see the source code for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'. Octave was configured for "i486-pc-linux-gnu". Additional information about Octave is available at http://www.octave.org. Please contribute if you find this software useful. For more information, visit http://www.octave.org/help-wanted.html Report bugs to (but first, please read http://www.octave.org/bugs.html to learn how to write a helpful report). For information about changes from previous versions, type `news'. octave:1> A=[ 1 9; 0 4; 2 0; 1 0] A = 1 9 0 4 2 0 1 0 octave:2> [Q,R]=qr(A) Q = -0.40825 -0.82076 -0.35741 -0.17871 -0.00000 -0.43774 0.80418 0.40209 -0.81650 0.32831 0.34297 -0.32852 -0.40825 0.16415 -0.32852 0.83574 R = -2.44949 -3.67423 0.00000 -9.13783 0.00000 0.00000 0.00000 0.00000 octave:3> Q'*Q ans = 1.0000e+00 -2.6086e-16 -6.5174e-17 -5.5267e-17 -2.6086e-16 1.0000e+00 5.9336e-17 3.8787e-17 -6.5174e-17 5.9336e-17 1.0000e+00 -3.1903e-17 -5.5267e-17 3.8787e-17 -3.1903e-17 1.0000e+00 octave:4> Q'*Q-eye(4) ans = -3.3307e-16 -2.6086e-16 -6.5174e-17 -5.5267e-17 -2.6086e-16 -2.2204e-16 5.9336e-17 3.8787e-17 -6.5174e-17 5.9336e-17 0.0000e+00 -3.1903e-17 -5.5267e-17 3.8787e-17 -3.1903e-17 0.0000e+00 octave:5> norm(Q'*Q-eye(4),1) ans = 7.1437e-16 octave:6> Q*R-A ans = -2.2204e-16 -3.5527e-15 0.0000e+00 0.0000e+00 0.0000e+00 -1.5673e-15 0.0000e+00 -8.5446e-16 octave:7> norm(Q*R-A,1) ans = 5.9745e-15 octave:8> Q(:,1) ans = -0.40825 -0.00000 -0.81650 -0.40825 octave:9> A(:,1) ans = 1 0 2 1 octave:10>