function Q = gramschmidtbyqr(B)
%  Gram-Schmidt orthonormalization of column vectors of matrix \texttt{B} by
%  using the QR-decompoisition provided by MATLAB. 
% Note that the orthonormal vectors are unique only up to sign so that this
% function and the function \texttt{gramschmidt} may not produce the same
% output. 
[Q,R] = qr(B);