57c57 < if (nargin > 5 || nargin < 3 || nargout > 4 || nargout < 2) --- > if (nargin > 5 || nargin < 3 || nargout > 4) 129,130c129,134 < ## convert to the correct output form < if (nargout == 2) --- > ## convert to the correct output form including > ## matlab compatible orientation bug # 49318 > ## note that poly always outputs a row vector > if ((nargout == 0) || (nargout == 1)) #fix bug 49990 > a = real (gain * poly (zero)); > elseif (nargout == 2) 134,135c138,139 < a = zero; < b = pole; --- > a = zero (:); > b = pole (:); 151a156,178 > %% Test output orientation for matlab compatibility (bug #49318) > %% also verify single nargout is valid (bug #49990) > %!test > %! cheby1 (3, 4, .5); > %! assert (isrow (ans), true); > %!test > %! A = cheby1 (3, 4, .5); > %! assert (isrow (A), true); > %!test > %! [A, B] = cheby1 (3, 4, .5); > %! assert (isrow (A), true); > %! assert (isrow (B), true); > %!test > %! [z, p, g] = cheby1 (3, 4, .5); > %! assert (iscolumn (z), true); > %! assert (iscolumn (p), true); > %! assert (isscalar (g), true); > %!test > %! [a, b, c, d] = cheby1 (3, 4, .5); > %! assert (ismatrix (a), true); > %! assert (iscolumn (b), true); > %! assert (isrow (c), true); > %! assert (isscalar (d), true); \ No newline at end of file