Get zero, poles and gain from state space model? I'm going to transform a state space model:
$$\dot{x} = Ax + Bu \\ y = Cx + Du$$
Into a transfer function:
$$G(s) = \frac{Y(s)}{U(s)}$$
What I need is to find the zeros, poles and gain. Finding poles are really easy. I just find the eigenvalues of the matrix $A$.
$$det(sI-A) = 0$$
Then I get the poles $$s_i = a\Re_i + b\Im_i$$
But how about the gain and zeros? How do I find them?

I found the answer!
The zeros can be computed by
$$(z\begin{bmatrix}
I &0 \\ 
0 & 0
\end{bmatrix}-\begin{bmatrix}
A & B\\ 
C & D
\end{bmatrix}) = 0$$
MATLAB / Octave command:
>> zero = qz(A, B) 

Which computes the generalized eigenvalues lambda of (sB-A)
