This code provides a function for finding the reduced row echelon form of a matrix. The reduced row echelon form is a canonical form for a matrix that is often used in linear algebra and other mathematical applications.
This code requires the numpy
library.
There are two main functions in this code:
-
input_matrix()
: This function prompts the user to input a matrix by specifying the number of rows and columns, and then allowing the user to enter each element of the matrix. The function returns the matrix input by the user as anumpy
array. -
find_reduced_row_echelon_form(matrix)
: This function takes a matrix as anumpy
array and returns the reduced row echelon form of the matrix.
Here is an example of how to use these functions:
matrix = input_matrix()
reduced_matrix = find_reduced_row_echelon_form(matrix)
print(reduced_matrix)
This code currently only works for matrices with numerical elements. It does not support matrices with complex or symbolic elements.
- Reduced Row Echelon Form on Wikipedia
- Row Echelon Form on MathWorld