title: Control Toolbox: How does the function minreal work in Matlab?
body: <p>I have a question about the function “minreal” in Matlab. From the help of Matlab I would assume that the output is a minimal realization of a system. To my understanding it means that the output function is observable and controllable.</p>
  
  <p>Example:</p>
  
  <pre><code>num = [ 6.40756397363316, -4511.90326777420, 7084807.91317081, -3549645853.18273, 2307781024837.00, -761727788683491, 2.26760542619190e+17, -1.54992537527829e+19, 5.58719150155001e+21 ];
  den = [ 1, 824.614362937241, 1036273.19811846, 592905955.793358, 319582996989.696, 106244022544031, 2.87990542333047e+16, 2.36284104437760e+18, 3.50241006466156e+20, 0];
  G = tf(num,den);
  G_min = minreal(ss(G));
  </code></pre>
  
  <p>But it is not a minimal realization:</p>
  
  <pre><code>&gt;&gt; size(G_min)
  State-space model with 1 outputs, 1 inputs, and 9 states.
  &gt;&gt; rank(obsv(G_min))
  ans =     6
  &gt;&gt; rank(ctrb(G_min))
  ans =     5
  </code></pre>
  
  <p>So obviously: rank(obsv(G_min)) != rank(ctrb(G_min))  != 9 (number of states).</p>
  
  <p>Where is my mistake?
  Thank you very much.</p>