Writing systems of equations as matrix equations