Learn R Programming

quhomology (version 1.1.1)

matrix_rank: Calculates the rank of a matrix.

Description

This function calculates the rank of a matrix, using Gaussian elimination.

Usage

matrix_rank(A)

Arguments

A

A matrix, the rank of which one wants to know.

Value

An integer, the rank of the matrix.

See Also

GaussianElimination

Examples

Run this code
# NOT RUN {
test_mat <- matrix(c(2,4,4, -6,6,12, 10,-4,-16), nrow=3, ncol=3, byrow=TRUE)
matrix_rank(test_mat)
#output:
# 2
# }

Run the code above in your browser using DataLab