Linear Equations -- JHU MATLAB Help Page
LINEAR EQUATIONS
 

Creating a Matrix
Substituting Within a Symbolic Matrix
Manipulating Regular Matrices
Vectors
Scalar Multiplication
Addition of Matrices
Gauss-Jordan Elimination
Reduced Row-Echelon Form
Dot Product
Rank
Number of Solutions
Reduced Row-Echelon Form
How to Examples Exercise
How to:
In the
last section, we learned how to put a matrix in Reduced Row-Echelon Form (rref) using Gauss-Jordan Elimination, and to be quite honest it was quite a hassle! It had 4 separate steps that had to be repeated multiple times! Luckily, MATLAB has a separate command that does all the work for you. Why didn't I share this command in the last section? Because, it helped us get a lot of practice with MATLAB and demonstrate where the answer comes from.

To simply put a matrix in Reduced Row-Echelon Form:
     A = rref(A)


Examples:
Let's take the matrix from last section, R = [2 4 4; 1 2 9; 2 4 15] and use our new command on it:
     R = rref(R)

One simple line, and it spits out the same, exact answer we got through multiple steps in the last section: R = [1 2 0; 0 0 1; 0 0 0].


Exercise: