Mo logo [home] [lexicon] [problems] [tests] [courses] [auxiliaries] [notes] [staff] german flag

Mathematics-Online course: Linear Algebra - Linear Systems of Equations - Classification and General Structure

Solution of Linear Systems of Equations and Matrix Inversion


[previous page] [next page] [table of contents][page overview]

A linear system $ Ax=b$ can be solved in MATLAB with the command x=A\b.
Depending on the dimensions different techniques are used.

In case of numerically instable matrices or in case of systems with loss of rank a warning will be displayed. (The matrix is close to singular or badly scaled.)

The MATLAB function inv inverts a regular square matrix:

$\displaystyle A \_ inverse = {\tt inv(A)}.
$

Hence, an $ n \times n$ linear system can also be solved via

$\displaystyle {\tt x=inv(A)*B}.
$

However, calculating the solution by x=A\b should definitely be preferred, since the \-command uses more efficient and more stable algorithms.

Finally,

$\displaystyle [Q, R, P] = qr(A)
$

generates the QR-factorization of an $ m \times n$-matrix A:

$\displaystyle A P = Q R,
$

where $ P$ is a permutation matrix, $ Q$ is unitary and $ R$ generalized upper triangular.


  automatically generated 4/21/2005