Learn R Programming

matlib (version 0.8.1)

echelon: Echelon Form of a Matrix

Description

Returns the reduced row-echelon form of the matrix X, using gaussianElimination. It is nothing more than a synonym for Gaussian elimination, but offers the possibility to show the steps using verbose=TRUE.

Usage

echelon(X, ...)

Arguments

X

a matrix

...

other arguments passed to gaussianElimination

Value

the reduced echelon form of X.

Details

When the matrix x is square and non-singular, the result will be the identity matrix. Otherwise, the result will have some all-zero rows, and the rank of the matrix is the number of not all-zero rows.

Examples

Run this code
# NOT RUN {
A <- matrix(c(2, 1, -1,
             -3, -1, 2,
             -2,  1, 2), 3, 3, byrow=TRUE)
b <- c(8, -11, -3)
echelon(A, b, verbose=TRUE, fractions=TRUE)

A <- matrix(c(1,2,3,4,5,6,7,8,10), 3, 3) # a nonsingular matrix
A
echelon(A) # the reduced row-echelon form of A

b <- 1:3
echelon(A, b)  # solving the matrix equation Ax = b
echelon(A, diag(3)) # inverting A

B <- matrix(1:9, 3, 3) # a singular matrix
B
echelon(B)
echelon(B, b)
echelon(B, diag(3))

# }

Run the code above in your browser using DataLab