# qrinsert

## Purpose

Insert a column in the QR factorization.

## Synopsis

    [Q,R] = qrinsert(Q,R,j,x)

## Description

`[Q,R] = qrinsert(Q,R,j,x)`, where the inputs `Q` and `R` are the original QR factorization of a matrix `A`, returns `Q` and `R` as the QR factorization of the matrix `A` with an additional column, `x`, inserted before `A(:,j)`. If `A` has `n` columns and `j = n+1`, then `qrinsert` inserts `x` after the last column of `A`.

## Algorithm

`qrinsert` inserts the values of `x` into the `j`-th column of `R`. It then uses a series of Givens rotations to zero out the nonzero elements of `R` on and below the diagonal in the `j`-th column.

## See Also

     qr, qrdelete

(c) Copyright 1994 by The MathWorks, Inc.