MATLAB Function Reference Previous page   Next Page
qrinsert

Insert column or row into QR factorization

Syntax

Description

[Q1,R1] = qrinsert(Q,R,j,x) returns the QR factorization of the matrix A1, where A1 is A = Q*R with the column x inserted before A(:,j). If A has n columns and j = n+1, then x is inserted after the last column of A.

[Q1,R1] = qrinsert(Q,R,j,x,'col') is the same as qrinsert(Q,R,j,x).

[Q1,R1] = qrinsert(Q,R,j,x,'row') returns the QR factorization of the matrix A1, where A1 is A = Q*R with an extra row, x, inserted before A(j,:).

Examples

returns a valid QR factorization, although possibly different from

Algorithm

The qrinsert function inserts the values of x into the jth column (row) 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 jth column (row).

See Also

planerot, qr, qrdelete


Previous page  qrdelete qrupdate Next page

© 1994-2005 The MathWorks, Inc.