One property of matrices that I found very interesting is the fact that if you have two functions of the same form $$f_0(x)=\frac{ax+b}{cx+d}$$ $$f_1(x)=\frac{a'x+b'}{c'x+d'}$$ then the function $f_0\circ f_1$ is in the same form, and if you put the coefficients $a,b,c,d$ and $a',b',c',d'$ into two matrices like this: $$\begin{pmatrix} a&b \\ c&d \end{pmatrix}$$ $$\begin{pmatrix} a'&b' \\ c'&d' \end{pmatrix}$$ Then the coefficients of $f_0\circ f_1$ are given by the matrix $$\begin{pmatrix} a&b \\ c&d \end{pmatrix}\begin{pmatrix} a'&b' \\ c'&d' \end{pmatrix}$$ I use this property quite often when dealing with the composition of rational functions with linear numerators and denominators since it spares me the trouble of putting myself through some unnecessary algebra.
Whilst thinking about this property, however, I was wondering if there is an analogous type of function that corresponds to a three-by-three matrix. I'm looking for some type of function so that if $g$ and $g_0$ are of this type such that the ambiguous non-$x$ variables of the type of function (suppose they are $a,b,c,d,e,f,g,h,i$ and $a',b',c',d',e',f',g',h',i'$) can be assigned to two three-by-three matrices $$\begin{pmatrix} a&b&c \\ d&e&f \\ g&h&i \end{pmatrix}$$ $$\begin{pmatrix} a'&b'&c' \\ d'&e'&f' \\ g'&h'&i' \end{pmatrix}$$ and the matrix corresponding to $g\circ g_0$ is $$\begin{pmatrix} a&b&c \\ d&e&f \\ g&h&i \end{pmatrix}\begin{pmatrix} a'&b'&c' \\ d'&e'&f' \\ g'&h'&i' \end{pmatrix}$$
Can anyone find a type of function like this? This would be very helpful to me in my studies of iterated functions.