<p dir="auto">Running TestSS2TF.tst_matrix_shapes(p,q,r) (signal/tests/test_ltisys.py, line 14, scipy 0.11.0) with p,q,r values like in the test, and repeated here:<br>
(3,3,3)<br>
(1,3,3)<br>
(1,1,3)</p>
<p dir="auto">However, it will fail with:<br>
(2,3,3)<br>
(2,2,3)</p>
<p dir="auto">and so on where p is not the same as r, and is also not 1. Traceback below:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;C:\Python27\Lib\site-packages\scipy\signal\tests\test_ltisys.py&quot;, line 17, in tst_matrix_shapes
    np.zeros((r, q)), 0)
  File &quot;C:\Python27\lib\site-packages\scipy\signal\ltisys.py&quot;, line 176, in ss2tf
    type_test = A[:, 0] + B[:, 0] + C[0, :] + D
ValueError: operands could not be broadcast together with shapes (2) (3) "><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "C:\Python27\Lib\site-packages\scipy\signal\tests\test_ltisys.py", line 17, in tst_matrix_shapes
    np.zeros((r, q)), 0)
  File "C:\Python27\lib\site-packages\scipy\signal\ltisys.py", line 176, in ss2tf
    type_test = A[:, 0] + B[:, 0] + C[0, :] + D
ValueError: operands could not be broadcast together with shapes (2) (3) 
</code></pre></div>
<p dir="auto">I suspect that D should be subscripted in the type_test assignment in ltisys.py, but I haven't dug far enough to know if it will still work even if the type_test is changed.</p>
<ol dir="auto">
<li>ltisys:150:
<ul dir="auto">
<li>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="`# transfer function is C (sI - A)**(-1) B + D`"><pre class="notranslate"><code class="notranslate">`# transfer function is C (sI - A)**(-1) B + D`
</code></pre></div>
should read:<br>
<code class="notranslate">#  transfer matrix is C (sI - A)**(-1) B + D</code></li>
<li>Although, this matrix is not actually calculated, so the comment should probably be removed.</li>
</ul>
</li>
<li>ltisys:179:
<ul dir="auto">
<li>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="`type_test = A[:, 0] + B[:, 0] + C[0, :] + D`"><pre class="notranslate"><code class="notranslate">`type_test = A[:, 0] + B[:, 0] + C[0, :] + D`
</code></pre></div>
</li>
<li>Results in an error when a system with multiple <strong>ouputs</strong> is passed to ss2tf.</li>
</ul>
</li>
</ol>
<p dir="auto">Suggested fix: add an optional argument 'output' which specifies the output for which the transfer function is desired.</p>