powered by
This function calculates the rank of a matrix, using Gaussian elimination.
matrix_rank(A)
A matrix, the rank of which one wants to know.
An integer, the rank of the matrix.
GaussianElimination
# 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