Reduced Row Echelon Form:
The Gauss Jordan technique results in a diagonal form; for illustration, for a 3 × 3 system:
The Reduced Row Echelon Forms take this one step further to answer in all 1's instead of a', therefore the column of b's is the solution:
The MATLAB has a built-in function to do this, known rref. For illustration, for the preceding illustration:
>> a = [1 3 0; 2 1 3; 4 2 3];
>> b = [1 6 3]';
>> ab = [a b];
>> rref(ab)
ans =
1 0 0 -2
0 1 0 1
0 0 1 3
The answer is found from the last column, therefore x_{1} = -2, x_{2} = 1, and x_{3} = 3. To obtain this in a column vector in a MATLAB:
>> x = ans(:,end)
x =
-2
1
3