Skip to Main Content Skip to Search
Product Documentation

rref - Reduced row echelon form

Syntax

R = rref(A)
[R,jb] = rref(A)
[R,jb] = rref(A,tol)

Description

R = rref(A) produces the reduced row echelon form of A using Gauss Jordan elimination with partial pivoting. A default tolerance of (max(size(A))*eps *norm(A,inf)) tests for negligible column elements.

[R,jb] = rref(A) also returns a vector jb such that:

[R,jb] = rref(A,tol) uses the given tolerance in the rank tests.

Roundoff errors may cause this algorithm to compute a different value for the rank than rank, orth and null.

Examples

Use rref on a rank-deficient magic square:

A = magic(4), R = rref(A)

A =
   16    2    3   13
    5   11   10    8
    9    7    6   12
    4   14   15    1

R =
    1    0    0    1
    0    1    0    3
    0    0    1   -3
    0    0    0    0

See Also

inv | lu | rank

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS