GaussJordan 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.
linalg::gaussJordan(A
, <All>)
linalg::gaussJordan(A)
performs GaussJordan
elimination on the matrix A,
i.e., it returns the reduced row echelon form of A.
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
, then the leading entries of the
matrix T in
reduced row echelon form are equal to one.
If R is
a ring providing the method "gcd"
, then the components
of each row of T do
not have a nontrivial common divisor.
If the component ring of A
is a field, then
the reduced row echelon form is unique.
We apply GaussJordan elimination to the following matrix:
A := Dom::Matrix(Dom::Rational)( [[1, 2, 3, 4], [5, 0, 3, 0], [3, 5, 6, 9]] )
linalg::gaussJordan(A, All)
We see that rank(B)
= 3. Because the determinant of a matrix is only
defined for square matrices, the third element of the returned list
is the value FAIL
.
If we consider the matrix from Example 1 as an integer matrix and apply the GaussJordan elimination we get the following matrix:
B := Dom::Matrix(Dom::Integer)( [[1, 2, 3, 4], [5, 0, 3, 0], [3, 5, 6, 9]] ): linalg::gaussJordan(B)

A matrix of a domain of category 

Returns a list
where T is
the reduced 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 reduced 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. In addition, if A is defined over a field: t_{i, ji} = 1.
For each i ∈ {r + 1, …, m}: t_{i, j} = 0 for each j ∈ {1, …, n}.
For each i ∈ {1, …, r}: t_{k, ji} = 0 for each k ∈ {1, …, i  1}.
The indices j_{1}, j_{2}, …, j_{r} are the characteristic column indices of the matrix T.