rref_test, a MATLAB code which calls rref(), which evaluates the reduced row echelon form (RREF) of a matrix, which can be singular or rectangular.
While the RREF is often used in introductory linear algebra courses, it is very susceptible to roundoff error, and hence the results of many of the tasks which it is used to illustrate can only be relied on when the matrix is small, contains only integer entries, and care is taken to avoid any division operation that is not exact.
The RREF can be regarded as a form of Gauss-Jordan elimination, applied to a general MxN matrix.
A matrix is in reduced row echelon form if:
MATLAB includes a build in function
R = rref ( A );which returns in R the RREF of matrix A. It also uses a tolerance to try to mitigate the susceptibility of the algorithm to roundoff.
The RREF can be used to determine:
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
rref_test is available in a MATLAB version.
llsq, a MATLAB code which solves the simple linear least squares (LLS) problem of finding the formula of a straight line y=a*x+b which minimizes the root-mean-square (RMS) error to a set of N data points.
polyominoes, a MATLAB code which defines, solves, and plots a variety of polyomino tiling problems, which are solved by a direct algebraic approach involving the reduced row echelon form (RREF) of a specific matrix, instead of the more typical brute-force or backtracking methods.
qr_solve, a MATLAB code which computes the linear least squares (LLS) solution of a rectangular linear system A*x=b.
test_lls, a MATLAB code which implements linear least squares (LLS) test problems which seek a vector x which minimizes the error in the rectangular linear system A*x=b.