# qr

Version:

Performs the QR decomposition of an input matrix with or without column pivoting.

## Syntax

r = qr(a)
r = qr(a, 0)
[q, r] = qr(a)
[q, r] = qr(a, 0)
[q, r, pm] = qr(a)
[q, r, pv] = qr(a, 0)

Matrix.

## 0

Specifies that MathScript computes the economy size QR decomposition such that the size of q is m-by-min(m, n) and the size of r is min(m, n)-by-n, where a is an m-by-n matrix.

## q

Orthogonal or unitary matrix of the QR decomposition of a.

## r

Upper triangular matrix of the QR decomposition of a.

## pm

Pivot matrix of the QR decomposition of a. pm is a matrix of 32-bit signed integers.

## pv

Pivot vector of the QR decomposition of a. pv is a row vector of 32-bit signed integers.

## Column Pivoting

The QR decomposition of a matrix a without column pivoting computes matrices q and r such that q*r = a, where q is an orthogonal or unitary matrix and r is an upper triangular matrix.

The QR decomposition of a matrix a with column pivoting computes matrices q and r and the pivot matrix pm or the pivot vector pv such that q*r = a*pm or q*r = a(pv). MathScript performs column pivoting on a such that the diagonal elements of r are in decreasing order.

A = rand(2);
[Q, R, P] = qr(A)

Where This Node Can Run:

Desktop OS: Windows

FPGA: This product does not support FPGA devices