23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Arithmetic Operators + - * / \ ^ '<br />

• If A is Hessenberg, it is reduced to an upper triangular matrix and that<br />

system is solved via substitution.<br />

• If A is square, but not a permutation of a triangular matrix, or is not Hermitian<br />

with positive elements, or the Cholesky factorization fails, then a general<br />

triangular factorization is computed by Gaussian elimination with partial<br />

pivoting (see lu). This results in<br />

A = L∗U<br />

where L is a permutation of a lower triangular matrix and U is an upper<br />

triangular matrix. Then X is computed by solving two permuted triangular<br />

systems.<br />

X = U\(L\B)<br />

If A is sparse, a nonsymmetric minimum degree preordering is applied (see<br />

colmmd and spparms). The algorithm is<br />

perm = colmmd(A); % Column minimum degree ordering<br />

[L,U,P] = lu(A(:,perm)); % Cholesky factorization<br />

Y = L\(P*B); % Lower triangular solve<br />

X(perm,:) = U\Y; % Upper triangular solve<br />

• If A is not square and is full, then Householder reflections are used to compute<br />

an orthogonal-triangular factorization.<br />

A∗P = Q∗R<br />

where P is a permutation, Q is orthogonal and R is upper triangular (see qr).<br />

The least squares solution X is computed with<br />

X = P∗(R\(Q'∗B)<br />

• If A is not square and is sparse, then <strong>MATLAB</strong> computes a least squares<br />

solution using the sparse qr factorization of A.<br />

Note Backslash is not implemented for matrices A that are not square, and<br />

are also sparse and complex.<br />

2-15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!