To type in your matrix, state the size and then type the entries from left to right, top to bottom. To row reduce a matrix, use the command .rref().
Beware: even though we generally type numbers into a matrix using rows, you'll almost always want to think of vectors as columns.
<sagecell> A=matrix(3,4,[1,1,2,7,1,2,3,9,2,1,4,15])
R=A.rref() #Compute the rref
- The commands below put the output into a nice table.
table([ ["$A$", A], ["Reduced Row Echelon Form", R], ]) </sagecell>
There are other ways to enter an augmented matrix.
<sagecell> A=matrix([ [1,1,2,7], [1,2,3,9], [2,1,4,15] ])
A.rref() #Compute the rref
</sagecell>
{{page>get_sage}}