# How to calculate the lower triangular matrix as in QR factorization in matlab?

Tried >[Q,R] = qr(a)

R is upper triangular part of >qr(a) as qr(a)'s lower triangular part has value but how to calculate the >qr(a).

Would like to do this in F# but Sho library's Q, R are different from matlab, hope there is a way to fix it.

Just type qr(a) but not [Q,R] = qr(a), then you will see qr(a)'s direct result

-
I don't understand your question. The $QR$ factorization $A = QR$ has $Q$ to be an orthonormal matrix and $R$ is an upper triangular matrix. Where does the lower triangular matrix enter the picture? –  user17762 Mar 18 '12 at 3:17
don't use [Q,R] = qr(a), just type qr(a) in matlab then you will see it display result directly. upper triangular part of this result is R, how about the lower triangular part –  M-Askman Mar 19 '12 at 14:07
I can't check since the computer I am using doesn't have MATLAB, but the usual Householder algorithm for computing the QR decomposition stores the Householder vectors used for constructing the orthogonal factor in the lower triangular portion. I don't know if MATLAB maintains that format, but I don't quite understand why you need the Householder vectors when @Sivaram already showed you how to obtain the explicit orthogonal factor. –  Ｊ. Ｍ. Mar 19 '12 at 15:09