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

Mathematics-Online lexicon:

Solvability of Linear Systems of Equations and Matrix Inversion with MATLAB


A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 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.

see also:


[Examples]

  automatically generated 3/ 8/2007