rrefReduced row echelon form
rref(A)A is a numeric (non-character) matrix.A.max(size(A))*eps(norm(A, inf))
A) is less than this tolerance.rref(A, tol)A is as specified in the description of rref(A) above.A using the tolerance tol.tol should be a non-negative real scalar, not equal to Inf nor NaN.[R, b] = rref(A)A is the same as specified above for rref(A).R and a vector b that contains indexes of A's basis in the column space.max(size(A))*eps(norm(A, inf))
[R, b] = rref(A, tol)A is the same as specified above for rref(A).R and a vector b that contains indexes of A's basis in the column space.tol to determine if an element is negligibly small.A has different rrefs with different tolerances.A = [16.00 2.000 3.000 13.00
5.000 11.00 10.00 8.000
9.000 7.000 6.000 12.00
4.000 14.00 15.00 1.000]
% U is the row echelon form.
[L,U] = lu(A);
U, U(4,4)
% U(4,4) ~1e-15 is very small, which
% is considered zero when the
% default tolerance is used.
% This results in rank 3.
R = rref(A)
% However, when a smaller tolerance
% is used, it is considered non-zero.
% This results in rank 4.
R = rref(A,1e-17)
A =
16.00 2.000 3.000 13.00
5.000 11.00 10.00 8.000
9.000 7.000 6.000 12.00
4.000 14.00 15.00 1.000
U =
16.00 2.000 3.000 13.00
0.000 13.50 14.25 -2.250
0.000 0.000 -1.889 5.667
0.000 0.000 0.000 0.000
ans = 1e-15 ×
3.553
R =
1.000 0.000 0.000 1.000
0.000 1.000 0.000 3.000
0.000 0.000 1.000 -3.000
0.000 0.000 0.000 0.000
R =
1.000 0.000 0.000 0.000
0.000 1.000 0.000 0.000
0.000 0.000 1.000 0.000
0.000 0.000 0.000 1.000
b suggests that the first 3 columns of A form a basis of the column space.A = [1 -5 2 -2;
-1 4 0 3;
1 -1 2 2]
[R,b] = rref(A)
A =
1.000 -5.000 2.000 -2.000
-1.000 4.000 0.000 3.000
1.000 -1.000 2.000 2.000
R =
1.000 0.000 0.000 1.000
0.000 1.000 0.000 1.000
0.000 0.000 1.000 1.000
b =
1.000 2.000 3.000