linalg
::gaussElim
Gaussian elimination
MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
For Gaussian Elimination in MATLAB^{®}, see the Symbolic Math
Toolbox™ rref
function.
linalg::gaussElim(A
, <All>)
linalg::gaussElim(A)
performs Gaussian elimination
on the matrix A to
reduce A to
a similar matrix in upper row echelon form.
A row echelon form of A
returned by linalg::gaussElim
is
not unique. See linalg::gaussJordan
for
computing the reduced row echelon form.
The component ring R of A
must
be an integral domain, i.e., a domain of category Cat::IntegralDomain
.
If R is
a field, i.e., a domain of category Cat::Field
, ordinary Gaussian elimination
is used. Otherwise, linalg::gaussElim
applies fractionfree
Gaussian elimination to A
.
linalg::gaussElim
serves as an interface
function for the method "gaussElim"
of the matrix
domain of A
, i.e., one may call A::dom::gaussElim(A)
directly
instead of linalg::gaussElim(A, All)
Refer to the help page of Dom::Matrix
for details about the computation
strategy of linalg::gaussElim
.
We apply Gaussian elimination to the following matrix:
A := Dom::Matrix(Dom::Rational)( [[1, 2, 3, 4], [1, 0, 1, 0], [3, 5, 6, 9]] )
which reduces A
to the following row echelon
form:
linalg::gaussElim(A)
We apply Gaussian elimination to the matrix:
B := Dom::Matrix(Dom::Integer)( [[1, 2, 1], [1, 0, 1], [2, 1, 4]] )
and get the following result:
linalg::gaussElim(B, All)
We see that rank(B) = 3 and .

A matrix of a domain of category 

Returns a list where T is
a row echelon form of If 
a matrix of the same domain type as A
, or
the list [T, rank(A), det(A), {j_1,dots,j_r}]
when
the option All
is given (see below).
Let T = (t_{i, j})_{1 ≤ i ≤ m, 1 ≤ j ≤ n} be an m×n matrix. Then T is a matrix in an upper row echelon form, if r ∈ {0, 1, …, n} and indices j_{1}, j_{2}, …, j_{r} ∈ {1, …, n} exist with:
j_{1} < j_{2} < ··· < j_{r}.
For each i ∈ {1, …, r}: t_{i, 1} = t_{i, 2} = ··· = t_{i, ji  1} = 0.
For each i ∈ {r + 1, …, m}: t_{i, j} = 0 for each j ∈ {1, …, n}.
The indices j_{1}, j_{2}, …, j_{r} are the characteristic column indices of the matrix T.