|
Contents | Previous | Next | Subchapters |
| Syntax |
[Q, R] = qr(X) |
[Q, R] = qr(X, full) | |
[Q, R, E] = qr(X) | |
[Q, R, E] = qr(X, full) | |
| See Also | qred , lu , svd , schur |
X = Q * R
where X is a real, double-precision or complex matrix.
Q
If the argument full is not present, or if it is true,
Q is a
unitary matrix
with the same type and row dimension as
X.
(See below for a discussion of the case where full is false.)
R
is an
upper triangular
matrix with the same type and
dimension as X.
E
If both E and full are present,
E is a row vector with the same type and column dimension as
X such that
X(:,E) = Q * R
(if E is complex, you will have to first convert it to
integer, real or double-precision before using it in the expression above).
If E is present and full is not present,
E is a
permutation matrix
with the same column dimension as X such that
X = Q * R * E
full
The argument full if a logical scalar
If it is false and the column dimension
of X is less than its row dimension,
the output value of Q has the same dimension as X
and contains only the initial columns of a unitary matrix.
Otherwise the entire unitary matrix is returned in Q.
Example
x = {[.5, 1.], [1., .5]}
[q, r, e] = qr(x)
print q' * q
O-Matrix will respond
{
[ 1 , 0 ]
[ 0 , 1 ]
}
If you continue
q * r * e
O-Matrix will respond
{
[ 0.5 , 1 ]
[ 1 , 0.5 ]
}