Description Usage Arguments Details Value Author(s) Examples

View source: R/gaussian-elimination.R

Returns the (reduced) row-echelon form of the matrix `A`

, using `gaussianElimination`

.

1 |

`A` |
coefficient matrix |

`B` |
right-hand side vector or matrix. If |

`reduced` |
logical; should reduced row echelon form be returned? If |

`...` |
other arguments passed to |

When the matrix `A`

is square and non-singular, the reduced row-echelon result will be the
identity matrix, while the row-echelon from will be an upper triagle matrix.
Otherwise, the result will have some all-zero rows, and the rank of the matrix
is the number of not all-zero rows.

the reduced echelon form of `X`

.

John Fox

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ```
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) # reduced row-echelon form
echelon(A, b, reduced=FALSE, verbose=TRUE, fractions=TRUE) # row-echelon form
A <- matrix(c(1,2,3,4,5,6,7,8,10), 3, 3) # a nonsingular matrix
A
echelon(A, reduced=FALSE) # the row-echelon form of 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, reduced=FALSE)
echelon(B, b)
echelon(B, diag(3))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.