Mercurial > hg > octave-terminal
changeset 7133:1d0d7be2d0f8
[project @ 2007-11-08 16:25:44 by jwe]
author | jwe |
---|---|
date | Thu, 08 Nov 2007 16:25:44 +0000 |
parents | b01db194c526 |
children | ff0b965b65bc |
files | scripts/ChangeLog scripts/control/base/dcgain.m scripts/control/base/dre.m scripts/control/base/impulse.m scripts/control/base/step.m scripts/control/system/dmr2d.m scripts/control/system/ord2.m scripts/control/system/sys2ss.m scripts/control/system/sysdimensions.m scripts/control/system/sysgetsignals.m scripts/control/system/sysout.m scripts/control/system/tfout.m scripts/control/system/ugain.m scripts/control/system/zpout.m scripts/control/util/strappend.m |
diffstat | 15 files changed, 32 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,5 +1,14 @@ 2007-11-08 John W. Eaton <jwe@octave.org> + * control/base/dcgain.m, control/base/dre.m, + control/base/impulse.m, control/base/step.m, + control/system/dmr2d.m, control/system/ord2.m, + control/system/sys2ss.m, control/system/sysdimensions.m, + control/system/sysgetsignals.m, control/system/sysout.m, + control/system/tfout.m, control/system/ugain.m, + control/system/zpout.m, control/util/strappend.m: + Don't fail with usage message if nargout is too large. + * control/hinf/h2syn.m, control/hinf/hinf_ctr.m, control/hinf/hinfnorm.m, control/hinf/hinfsyn.m, control/hinf/hinfsyn_chk.m, control/hinf/is_dgkf.m,
--- a/scripts/control/base/dcgain.m +++ b/scripts/control/base/dcgain.m @@ -30,7 +30,7 @@ function gm = dcgain (sys, tol) - if (nargin < 1 || nargin > 2 || nargout > 1) + if (nargin < 1 || nargin > 2) print_usage (); endif if (! isstruct (sys))
--- a/scripts/control/base/dre.m +++ b/scripts/control/base/dre.m @@ -97,7 +97,7 @@ function [tvals, Plist] = dre (sys, Q, R, Qf, t0, tf, Ptol, maxits) - if (nargin < 6 || nargin > 8 || nargout != 2) + if (nargin < 6 || nargin > 8) print_usage (); elseif (! isstruct (sys)) error ("sys must be a system data structure")
--- a/scripts/control/base/impulse.m +++ b/scripts/control/base/impulse.m @@ -56,7 +56,7 @@ function [y, t] = impulse (sys, inp, tstop, n) - if (nargin < 1 || nargin > 4 || nargout > 2) + if (nargin < 1 || nargin > 4) print_usage (); endif
--- a/scripts/control/base/step.m +++ b/scripts/control/base/step.m @@ -57,7 +57,7 @@ function [y, t] = step (sys, inp, tstop, n) - if (nargin < 1 || nargin > 4 || nargout > 2) + if (nargin < 1 || nargin > 4) print_usage (); endif
--- a/scripts/control/system/dmr2d.m +++ b/scripts/control/system/dmr2d.m @@ -76,7 +76,7 @@ function [dsys, fidx] = dmr2d (sys, idx, sprefix, Ts2, cuflg) ## parse input arguments - if(nargin != 4 | nargout > 2) + if (nargin != 4) print_usage (); elseif (!isstruct(sys))
--- a/scripts/control/system/ord2.m +++ b/scripts/control/system/ord2.m @@ -65,16 +65,14 @@ ## Updates - if(nargin != 2 & nargin != 3) - print_usage (); - endif - if (nargout > 1) + if (nargin == 2 || nargin == 3) + if (nargin == 2) + gain = 1.0; + endif + w = 2.0 * pi * nfreq; + outsys = ss ([-2.0*w*damp, -w; w, 0], [w; 0], [0, gain]); + else print_usage (); endif - if (nargin == 2) - gain = 1.0; - endif - w = 2.0 * pi * nfreq; - outsys = ss ([-2.0*w*damp, -w; w, 0], [w; 0], [0, gain]); endfunction
--- a/scripts/control/system/sys2ss.m +++ b/scripts/control/system/sys2ss.m @@ -78,12 +78,7 @@ function [a, b, c, d, tsam, n, nz, stname, inname, outname, yd] = sys2ss (sys) - if(nargin != 1) - print_usage (); - endif - - if (nargout > 11) - warning(["sys2ss: ",num2str(nargout)," out arguments exceeds max=11"]) + if (nargin != 1) print_usage (); endif
--- a/scripts/control/system/sysdimensions.m +++ b/scripts/control/system/sysdimensions.m @@ -68,11 +68,11 @@ function [n, nz, m, p, yd] = sysdimensions (sys, opt) - if(nargout > 5 | nargin < 1 | nargin > 2) + if (nargin < 1 || nargin > 2) print_usage (); - elseif(!isstruct(sys)) - print_usage (); - elseif(nargin == 1) + elseif (! isstruct (sys)) + error ("sysdimensions: expecting system structure as first argument"); + elseif (nargin == 1) opt = "all"; endif
--- a/scripts/control/system/sysgetsignals.m +++ b/scripts/control/system/sysgetsignals.m @@ -146,9 +146,7 @@ ## Adapted from ss - if(nargin < 1 | nargin > 4 | nargout > 4) - print_usage (); - elseif(nargin > 1 & nargout > 1) + if (nargin < 1 || nargin > 4) print_usage (); elseif( ! isstruct(sys) ) error("input argument must be a system data structure");
--- a/scripts/control/system/sysout.m +++ b/scripts/control/system/sysout.m @@ -143,7 +143,7 @@ if(dmat) disp(dd); endif endif - if(nargout >= 1) + if (nargout >= 1) retsys = sys; endif
--- a/scripts/control/system/tfout.m +++ b/scripts/control/system/tfout.m @@ -30,7 +30,7 @@ function tfout (num, denom, x) - if (nargin < 2 ) | (nargin > 3) | (nargout != 0 ) + if (nargin < 2 || nargin > 3) print_usage (); endif
--- a/scripts/control/system/ugain.m +++ b/scripts/control/system/ugain.m @@ -31,7 +31,7 @@ function outsys = ugain (n) - if (nargin != 1 || nargout > 1) + if (nargin != 1) print_usage (); endif outsys = ss ([], [], [], eye (n));
--- a/scripts/control/system/zpout.m +++ b/scripts/control/system/zpout.m @@ -30,7 +30,7 @@ function zpout (zer, pol, k, x) - if (nargin < 3 ) | (nargin > 4) | (nargout != 0 ) + if (nargin < 3 || nargin > 4) print_usage (); endif
--- a/scripts/control/util/strappend.m +++ b/scripts/control/util/strappend.m @@ -24,7 +24,7 @@ function retval = strappend (strlist, suffix); - if (nargin != 2 || nargout > 1) + if (nargin != 2) print_usage (); elseif (! is_signal_list (strlist)) error ("strlist must be a list of strings (see is_signal_list)");