help with multivariable control loop
The basic equations
$$ z = -r + G u + d $$
$$ u = K v $$
$$ v = r -(n + z + r)) = - n - z$$

Therefore
$$ z = - r + G K (-n -z) + d$$
$$ (1 + G K) z = d - r - G K n$$
$$ z = \frac{1}{1+ G K} d + \frac{-1}{1+ G K} r + \frac{-G K}{1+ G K} n$$

The transfer function from \$w =\{d, r, n\}^T\$ to z is a 1x3 matrix

$$ \left(
\begin{array}{ccc}
 \frac{1}{1+ G K} &amp; \frac{-1}{1+ G K} &amp;  \frac{-G K}{1+ G K} \\
\end{array}
\right)$$