In the case of a system of linear equations say - $$x_1 + 3x_2 + x_3 = 1 $$ $$5x_1 + x_2 + x_3 = 4 $$ $$x_1 + x_2 + 7x_3 = 2$$
we denote this with a matrix as -
\begin{pmatrix} 1 & 3 & 1 & 1 \\ 5 & 1 & 1 & 4\\ 1 & 1 & 7 & 2 \end{pmatrix}
where the variables change row-wise and down the coloumns the variables are the same (what I mean is the variables corresponding to those coefficients are in this order)
Is it always like this or is it arbitrary ?
For example while representing basis vectors for R3, (assume the below matrix contains arbitrary basis vectors for R3)
\begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}
How will you interpret these vectors ? coloumn-wise or row-wise and is there a convention ?
We can write your system as$$\begin{pmatrix} 1 & 3 & 1 \\ 5 & 1 & 1 \\ 1 & 1 & 7 \end{pmatrix} \cdot \begin{pmatrix} x_1 \\ x_2\\ x_3 \end{pmatrix} = \begin{pmatrix} 1 \\ 4\\ 2 \end{pmatrix}$$ and that is how you get the matrix that you were talking about. This yields that the first column corresponds to the coefficients of $x_1$ etc.