The transfer function is $G(s)=Y(s)/U(s)$, where $U(s)$ is the input function and $Y(s)$ is the output function.
But how is this fraction justified if $Y(s)$ and $U(s)$ are vectors/matrices?
I have the following derivation of the transfer function from a state-space model. But I don't understand equation $(6)$ below.
\begin{align} \dot{\mathbf x}(t)&=A\mathbf x(t)+ B\mathbf u(t)\tag{1}\\ \mathbf y(t)&=C\mathbf x(t)+ D\mathbf u(t)\tag{2} \end{align} where $\mathbf x(t)\in \mathbb R^n$, $\mathbf y(t)\in \mathbb R^q, \mathbf u(t)\in\mathbb R^p$. The matrices are $A^{n\times n}$, $B^{n\times p}$, $C^{q\times n}$ and $D^{q\times p}$.
The Laplace transform of $(1)$, where the initial value is zero, gives $$ s\mathbf X(s)=A\mathbf X(s)+ B \mathbf U(s)\tag{3} $$
Simplifying this gives $(s\mathbf I-A)\mathbf X(s)=B\mathbf U(s)$, so $$ \mathbf X(s)=(s\mathbf I-A)^{-1}B\mathbf U(s) \tag{4} $$
Now, the Laplace transform of $(2)$ is $$ \mathbf Y(s)=C\mathbf X(s)+D\mathbf U(s) \tag{5} $$ Substituting $(4)$ in $(5)$ yields \begin{align} \mathbf Y(s)&=C(s\mathbf I-A)^{-1}B\mathbf U(s)+ D\mathbf U(s)\\ &=(C(s\mathbf I-A)^{-1}B+ D)\mathbf U(s) \tag{6} \end{align} Therefore the transfer function is $$ \mathbf G(s)=C(s\mathbf I-A)^{-1}B+D \tag{7} $$
How can we divide the vectors $\mathbf Y(s)$ and $\mathbf U(s)$ in $(6)$ to form the transfer function $\mathbf G(s)=\frac{\mathbf Y(s)}{\mathbf U(s)}$ in $(7)$?
There is no division here. We know that $$ \mathbf Y(s)=M(s)\mathbf U(s) =(C(s\mathbf I-A)^{-1}B+ D)\mathbf U(s) $$
where $M(s)$ is the transfer funcion ( a matrix in this case).