Transform matrix A into reduced row echelon form this function is written along the lines of the rref-matlab function.
Useful links