Each of the three types of elementary matrices can be constructed easily, with syntax similar to methods for performing row operations on matrices. Here we have three $4\times 4$ elementary matrices, in order: $\elemswap{1}{3}$, $\elemmult{7}{2}$, $\elemadd{9}{2}{4}$. Notice the change in numbering on the rows, and the order of the parameters.
Notice that row1 is always the row that is being changed. The keywords can be removed, but the scale keyword must be used to create the second type of elementary matrix, to avoid confusion with the first type.
We can illustrate some of the results of this section with two examples. First, we convert a matrix into a second matrix which is row-equivalent, and then accomplish the same thing with matrix multiplication and a product of elementary matrices.
The matrix R, the product of three elementary matrices, can be construed as the collective effect of the three row operations employed. With more row operations, R might look even less like an identity matrix. As the product of nonsingular matrices (Theorem EMN), R is nonsingular (Theorem NPNT).
The matrix B above is not in reduced row-echelon form (it was just row-equivalent to A). What if we were to begin with a matrix and track all of the row operations required to bring the matrix to reduced row-echelon form? As above, we could form the associated elementary matrices and form their product, creating a single matrix R that captures all of the row operations.
It turns out we have already done this. Extended echelon form is the subject of Theorem PEEF, whose second conclusion says that $B=JA$, where $A$ is the original matrix, and $B$ is the row-equivalent matrix in reduced row-echelon form. Then $J$ is a square nonsingular matrix that is the product of the sequence of elementary matrices associated with the sequence of row operations converting $A$ into $B$. There may be many, many different sequences of row operations that convert $A$ to $B$, but the requirement that extended echelon form be in reduced row-echelon form guarantees that $J$ is unique.