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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Algorithm The specific algorithm used for solving the simultaneous linear equations<br />

denoted by X = A\B and X = B/A depends upon the structure of the coefficient<br />

matrix A.<br />

2-14<br />

Matrix Operations Array Operations<br />

2^x Error 2.^x 2<br />

4<br />

8<br />

(x+i∗y)' 1 – 4i 2 – 5i 3 – 6i<br />

(x+i∗y).' 1 + 4i 2 + 5i 3 + 6i<br />

• If A is a triangular matrix, or a permutation of a triangular matrix, then X<br />

can be computed quickly by a permuted backsubstitution algorithm. The<br />

check for triangularity is done for full matrices by testing for zero elements<br />

and for sparse matrices by accessing the sparse data structure. Most<br />

nontriangular matrices are detected almost immediately, so this check<br />

requires a negligible amount of time.<br />

• If A is symmetric, or Hermitian, and has positive diagonal elements, then a<br />

Cholesky factorization is attempted (see chol). If A is found to be positive<br />

definite, the Cholesky factorization attempt is successful and requires less<br />

than half the time of a general factorization. Nonpositive definite matrices<br />

are usually detected almost immediately, so this check also requires little<br />

time. If successful, the Cholesky factorization is<br />

A = R'∗R<br />

where R is upper triangular. The solution X is computed by solving two<br />

triangular systems,<br />

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

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

symmmd and spparms). The algorithm is:<br />

perm = symmmd(A); % Symmetric minimum degree reordering<br />

R = chol(A(perm,perm)); % Cholesky factorization<br />

y = R'\B(perm); % Lower triangular solve<br />

X(perm,:) = R\y; % Upper triangular solve

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

Saved successfully!

Ooh no, something went wrong!