### 15.3.3 QR decomposition (for TI compatibility)

The QR command finds the QR decomposition of a matrix.

- QR takes three arguments:
  - A, a square matrix.
  - q and r, two variable names.
- QR(A,q,r) returns the matrix R from the QR decomposition of A, and assigns the matrices Q and R to the variables q and r.

#### Example

QR([[3,5],[4,5]],Q,R)

⎡ ⎢ ⎣ |
5 | 7
0 | 1
| ⎤ ⎥ ⎦

The result is the matrix R. To obtain Q:

Q

⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ |
3
5
4
5
4
5
− |
3
5
| ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦