title: The algorithm behind ss2tf in Matlab
body: <p>There are controllable and observable forms of <a href="http://lpsa.swarthmore.edu/Representations/SysRepTransformations/TF2SS.html" rel="nofollow">canonical</a> state-space  from a transfer function. 
  However, when I try <code>ss2tf</code> from Matlab, I receive a different result. What sort of algorithm does Matlab use? Is there any documentation or open source implementation of it too?</p>
  
  <pre><code>&gt;&gt; a = [1 0.4 1];
  &gt;&gt; b = [1 2 1];
  &gt;&gt; [A,B,C,D] = tf2ss(b,a)
  
  A =
  
     -0.4000   -1.0000
      1.0000         0
  
  
  B =
  
       1
       0
  
  
  C =
  
      1.6000         0
  
  
  D =
  
       1
  </code></pre>