Index: control/base/bode_bounds.m =================================================================== RCS file: /cvs/octave/scripts/control/base/bode_bounds.m,v retrieving revision 1.8 diff -u -p -r1.8 bode_bounds.m --- control/base/bode_bounds.m 12 Oct 2007 21:27:17 -0000 1.8 +++ control/base/bode_bounds.m 3 Nov 2007 21:47:03 -0000 @@ -35,7 +35,9 @@ ## @end deftypefn function [wmin, wmax] = bode_bounds (zer, pol, DIGITAL, tsam) - + + if ( nargin != 4 ), print_usage(); endif + ## make sure zer,pol are row vectors if(!isempty(pol)) pol = reshape(pol,1,length(pol)); endif if(!isempty(zer)) zer = reshape(zer,1,length(zer)); endif Index: control/base/dgram.m =================================================================== RCS file: /cvs/octave/scripts/control/base/dgram.m,v retrieving revision 1.8 diff -u -p -r1.8 dgram.m --- control/base/dgram.m 12 Oct 2007 21:27:17 -0000 1.8 +++ control/base/dgram.m 3 Nov 2007 21:47:03 -0000 @@ -61,6 +61,8 @@ function m = dgram (a, b) + if ( nargin != 2 ), print_usage(); endif + ## let dlyap do the error checking... m = dlyap (a, b*b'); Index: control/base/dlyap.m =================================================================== RCS file: /cvs/octave/scripts/control/base/dlyap.m,v retrieving revision 1.8 diff -u -p -r1.8 dlyap.m --- control/base/dlyap.m 12 Oct 2007 21:27:17 -0000 1.8 +++ control/base/dlyap.m 3 Nov 2007 21:47:03 -0000 @@ -90,6 +90,8 @@ function x = dlyap (a, b) + if ( nargin != 2 ), print_usage(); endif + if ((n = issquare (a)) == 0) warning ("dlyap: a must be square"); endif Index: control/base/freqchkw.m =================================================================== RCS file: /cvs/octave/scripts/control/base/freqchkw.m,v retrieving revision 1.9 diff -u -p -r1.9 freqchkw.m --- control/base/freqchkw.m 12 Oct 2007 21:27:17 -0000 1.9 +++ control/base/freqchkw.m 3 Nov 2007 21:47:04 -0000 @@ -29,6 +29,8 @@ function USEW = freqchkw (w) + if ( nargin != 1 ), print_usage(); endif + if (isempty (w)) USEW = 0; elseif (! isvector (w)) Index: control/base/gram.m =================================================================== RCS file: /cvs/octave/scripts/control/base/gram.m,v retrieving revision 1.7 diff -u -p -r1.7 gram.m --- control/base/gram.m 12 Oct 2007 21:27:17 -0000 1.7 +++ control/base/gram.m 3 Nov 2007 21:47:04 -0000 @@ -29,6 +29,8 @@ function m = gram (a, b) + if ( nargin != 2 ), print_usage(); endif + ## Let lyap do the error checking... m = lyap (a, b*b'); Index: control/base/place.m =================================================================== RCS file: /cvs/octave/scripts/control/base/place.m,v retrieving revision 1.11 diff -u -p -r1.11 place.m --- control/base/place.m 12 Oct 2007 21:27:18 -0000 1.11 +++ control/base/place.m 3 Nov 2007 21:47:04 -0000 @@ -45,6 +45,8 @@ function K = place (sys, P) + if ( nargin != 2 ), print_usage(); endif + ## check arguments if(!isstruct(sys)) Index: control/hinf/hinf_ctr.m =================================================================== RCS file: /cvs/octave/scripts/control/hinf/hinf_ctr.m,v retrieving revision 1.9 diff -u -p -r1.9 hinf_ctr.m --- control/hinf/hinf_ctr.m 12 Oct 2007 21:27:18 -0000 1.9 +++ control/hinf/hinf_ctr.m 3 Nov 2007 21:47:04 -0000 @@ -57,6 +57,8 @@ function K = hinf_ctr (dgs, F, H, Z, g) + if ( nargin != 5 ), print_usage(); endif + nw = dgs.nw; nu = dgs.nu; nz = dgs.nz; Index: control/hinf/hinfsyn_chk.m =================================================================== RCS file: /cvs/octave/scripts/control/hinf/hinfsyn_chk.m,v retrieving revision 1.7 diff -u -p -r1.7 hinfsyn_chk.m --- control/hinf/hinfsyn_chk.m 12 Oct 2007 21:27:18 -0000 1.7 +++ control/hinf/hinfsyn_chk.m 3 Nov 2007 21:47:04 -0000 @@ -80,6 +80,8 @@ function [retval, Pc, Pf] = hinfsyn_chk (A, B1, B2, C1, C2, D12, D21, g, ptol) + if ( nargin != 9 ), print_usage(); endif + Pc = Pf = []; ## Construct the two Hamiltonians Index: control/hinf/hinfsyn_ric.m =================================================================== RCS file: /cvs/octave/scripts/control/hinf/hinfsyn_ric.m,v retrieving revision 1.9 diff -u -p -r1.9 hinfsyn_ric.m --- control/hinf/hinfsyn_ric.m 12 Oct 2007 21:27:18 -0000 1.9 +++ control/hinf/hinfsyn_ric.m 3 Nov 2007 21:47:04 -0000 @@ -47,6 +47,8 @@ function [Xinf, x_ha_err] = hinfsyn_ric (A, BB, C1, d1dot, R, ptol) + if ( nargin != 6 ), print_usage(); endif + x_ha_err = 0; # assume success Xinf = []; # default return value n = issquare(A); Index: control/system/is_sample.m =================================================================== RCS file: /cvs/octave/scripts/control/system/is_sample.m,v retrieving revision 1.9 diff -u -p -r1.9 is_sample.m --- control/system/is_sample.m 12 Oct 2007 21:27:18 -0000 1.9 +++ control/system/is_sample.m 3 Nov 2007 21:47:04 -0000 @@ -28,6 +28,8 @@ function out = is_sample (Ts) + if ( nargin != 1 ), print_usage(); endif + out = (isscalar (Ts) && (Ts == abs (Ts)) && (Ts != 0)); endfunction Index: control/system/is_signal_list.m =================================================================== RCS file: /cvs/octave/scripts/control/system/is_signal_list.m,v retrieving revision 1.9 diff -u -p -r1.9 is_signal_list.m --- control/system/is_signal_list.m 12 Oct 2007 21:27:18 -0000 1.9 +++ control/system/is_signal_list.m 3 Nov 2007 21:47:04 -0000 @@ -24,6 +24,8 @@ function flg = is_signal_list (mylist) + if ( nargin != 1 ), print_usage(); endif + flg = iscell (mylist); if(flg) flg = (rows(mylist) == 1 | columns(mylist) == 1); Index: control/system/ss2tf.m =================================================================== RCS file: /cvs/octave/scripts/control/system/ss2tf.m,v retrieving revision 1.7 diff -u -p -r1.7 ss2tf.m --- control/system/ss2tf.m 12 Oct 2007 21:27:18 -0000 1.7 +++ control/system/ss2tf.m 3 Nov 2007 21:47:04 -0000 @@ -59,6 +59,8 @@ function [num, den] = ss2tf (a, b, c, d) + if ( nargin != 4 ), print_usage(); endif + ## Check args [n,m,p] = abcddim(a,b,c,d); if (n == -1) Index: control/system/sys2fir.m =================================================================== RCS file: /cvs/octave/scripts/control/system/sys2fir.m,v retrieving revision 1.9 diff -u -p -r1.9 sys2fir.m --- control/system/sys2fir.m 12 Oct 2007 21:27:18 -0000 1.9 +++ control/system/sys2fir.m 3 Nov 2007 21:47:04 -0000 @@ -30,6 +30,8 @@ function [c, tsam, inname, outname] = sys2fir (sys) + if ( nargin != 1 ), print_usage(); endif + ## let sys2tf do most of the work [num, den, tsam, inname, outname] = sys2tf (sys); Index: control/system/sysgettsam.m =================================================================== RCS file: /cvs/octave/scripts/control/system/sysgettsam.m,v retrieving revision 1.8 diff -u -p -r1.8 sysgettsam.m --- control/system/sysgettsam.m 12 Oct 2007 21:27:19 -0000 1.8 +++ control/system/sysgettsam.m 3 Nov 2007 21:47:04 -0000 @@ -24,6 +24,8 @@ function T = sysgettsam (sys) + if ( nargin != 1 ), print_usage(); endif + if (! isstruct (sys)) print_usage (); endif Index: control/system/sysgettype.m =================================================================== RCS file: /cvs/octave/scripts/control/system/sysgettype.m,v retrieving revision 1.10 diff -u -p -r1.10 sysgettype.m --- control/system/sysgettype.m 12 Oct 2007 21:27:19 -0000 1.10 +++ control/system/sysgettype.m 3 Nov 2007 21:47:04 -0000 @@ -39,6 +39,8 @@ function systype = sysgettype (sys) + if ( nargin != 1 ), print_usage(); endif + if (! isstruct (sys)) error ("sysgettype: input sys is not a structure"); endif Index: control/system/sysreorder.m =================================================================== RCS file: /cvs/octave/scripts/control/system/sysreorder.m,v retrieving revision 1.7 diff -u -p -r1.7 sysreorder.m --- control/system/sysreorder.m 12 Oct 2007 21:27:19 -0000 1.7 +++ control/system/sysreorder.m 3 Nov 2007 21:47:04 -0000 @@ -44,6 +44,8 @@ function pv = sysreorder (vlen, list) + if ( nargin != 2 ), print_usage(); endif + ## disp('sysreorder: entry') pv = 1:vlen; Index: control/system/tf2sys.m =================================================================== RCS file: /cvs/octave/scripts/control/system/tf2sys.m,v retrieving revision 1.9 diff -u -p -r1.9 tf2sys.m --- control/system/tf2sys.m 12 Oct 2007 21:27:19 -0000 1.9 +++ control/system/tf2sys.m 3 Nov 2007 21:47:04 -0000 @@ -63,7 +63,7 @@ ## name changed to tf Feb 2004 function outsys = tf2sys (varargin) - + warning("tf2sys is deprecated. Use tf() instead."); outsys = tf(varargin{:}); Index: control/system/zp2tf.m =================================================================== RCS file: /cvs/octave/scripts/control/system/zp2tf.m,v retrieving revision 1.7 diff -u -p -r1.7 zp2tf.m --- control/system/zp2tf.m 12 Oct 2007 21:27:19 -0000 1.7 +++ control/system/zp2tf.m 3 Nov 2007 21:47:04 -0000 @@ -37,6 +37,8 @@ function [num, den] = zp2tf (zer, pol, k) + if ( nargin != 3 ), print_usage(); endif + ## Find out whether data was entered as a row or a column vector and ## convert to a column vector if necessary. Index: control/util/axis2dlim.m =================================================================== RCS file: /cvs/octave/scripts/control/util/axis2dlim.m,v retrieving revision 1.9 diff -u -p -r1.9 axis2dlim.m --- control/util/axis2dlim.m 12 Oct 2007 21:27:19 -0000 1.9 +++ control/util/axis2dlim.m 3 Nov 2007 21:47:04 -0000 @@ -38,7 +38,7 @@ ## @end deftypefn function axvec = axis2dlim (axdata) - + if ( nargin != 1 ), print_usage(); endif if(isempty(axdata)) axdata = 0; endif Index: control/util/swap.m =================================================================== RCS file: /cvs/octave/scripts/control/util/swap.m,v retrieving revision 1.5 diff -u -p -r1.5 swap.m --- control/util/swap.m 12 Oct 2007 21:27:19 -0000 1.5 +++ control/util/swap.m 3 Nov 2007 21:47:04 -0000 @@ -30,7 +30,7 @@ ## Conversion to Octave R. Bruce Tenison July 4, 1994 function [a1, b1] = swap (a, b) - + if ( nargin != 2 ), print_usage(); endif a1 = b; b1 = a; Index: control/util/zgfmul.m =================================================================== RCS file: /cvs/octave/scripts/control/util/zgfmul.m,v retrieving revision 1.7 diff -u -p -r1.7 zgfmul.m --- control/util/zgfmul.m 12 Oct 2007 21:27:19 -0000 1.7 +++ control/util/zgfmul.m 3 Nov 2007 21:47:04 -0000 @@ -32,7 +32,7 @@ ## Conversion to Octave July 3, 1994 function y = zgfmul (a, b, c, d, x) - + if ( nargin != 5 ), print_usage(); endif [n,m] = size(b); [p,m1] = size(c); nm = n+m; Index: control/util/zgfslv.m =================================================================== RCS file: /cvs/octave/scripts/control/util/zgfslv.m,v retrieving revision 1.5 diff -u -p -r1.5 zgfslv.m --- control/util/zgfslv.m 12 Oct 2007 21:27:19 -0000 1.5 +++ control/util/zgfslv.m 3 Nov 2007 21:47:04 -0000 @@ -26,7 +26,7 @@ ## Converted to Octave by R Bruce Tenison, July 3, 1994 function x = zgfslv (n, m, p, b) - + if ( nargin != 4 ), print_usage(); endif nmp = n+m+p; gam1 = (2*n)+m+p; gam2 = n+p; gam3 = n+m; Index: control/util/zginit.m =================================================================== RCS file: /cvs/octave/scripts/control/util/zginit.m,v retrieving revision 1.6 diff -u -p -r1.6 zginit.m --- control/util/zginit.m 12 Oct 2007 21:27:19 -0000 1.6 +++ control/util/zginit.m 3 Nov 2007 21:47:04 -0000 @@ -33,7 +33,7 @@ ## Conversion to Octave by R. Bruce Tenison, July 3, 1994 function zz = zginit (a, b, c, d) - + if ( nargin != 4 ), print_usage(); endif [nn,mm] = size(b); [pp,mm] = size(d); Index: control/util/zgreduce.m =================================================================== RCS file: /cvs/octave/scripts/control/util/zgreduce.m,v retrieving revision 1.5 diff -u -p -r1.5 zgreduce.m --- control/util/zgreduce.m 12 Oct 2007 21:27:19 -0000 1.5 +++ control/util/zgreduce.m 3 Nov 2007 21:47:04 -0000 @@ -24,7 +24,7 @@ ## @end deftypefn function retsys = zgreduce (Asys, meps) - + if ( nargin != 2 ), print_usage(); endif ## SYS_INTERNAL accesses members of system data structure is_digital(Asys); # make sure it's pure digital/continuous Index: control/util/zgrownorm.m =================================================================== RCS file: /cvs/octave/scripts/control/util/zgrownorm.m,v retrieving revision 1.5 diff -u -p -r1.5 zgrownorm.m --- control/util/zgrownorm.m 12 Oct 2007 21:27:19 -0000 1.5 +++ control/util/zgrownorm.m 3 Nov 2007 21:47:05 -0000 @@ -25,7 +25,7 @@ ## @end deftypefn function [sig, tau] = zgrownorm (mat, meps) - + if ( nargin != 2 ), print_usage(); endif rownorm = []; for ii = 1:rows (mat) rownorm(ii) = norm (mat(ii,:)); Index: control/util/zgscal.m =================================================================== RCS file: /cvs/octave/scripts/control/util/zgscal.m,v retrieving revision 1.7 diff -u -p -r1.7 zgscal.m --- control/util/zgscal.m 12 Oct 2007 21:27:19 -0000 1.7 +++ control/util/zgscal.m 3 Nov 2007 21:47:05 -0000 @@ -33,7 +33,7 @@ ## Conversion to Octave R. Bruce Tenison July 3, 1994 function x = zgscal (a, b, c, d, z, n, m, p) - + if ( nargin != 8 ), print_usage(); endif ## initialize parameters: ## Givens rotations, diagonalized 2x2 block of F, gcg vector initialization Index: control/util/zgsgiv.m =================================================================== RCS file: /cvs/octave/scripts/control/util/zgsgiv.m,v retrieving revision 1.6 diff -u -p -r1.6 zgsgiv.m --- control/util/zgsgiv.m 12 Oct 2007 21:27:19 -0000 1.6 +++ control/util/zgsgiv.m 3 Nov 2007 21:47:05 -0000 @@ -29,7 +29,7 @@ ## Convertion to Octave by R. Bruce Tenison July 3, 1994 function [a, b] = zgsgiv (c, s, a, b) - + if ( nargin != 4 ), print_usage(); endif t1 = c*a + s*b; t2 = -s*a + c*b; a = t1; Index: control/util/zgshsr.m =================================================================== RCS file: /cvs/octave/scripts/control/util/zgshsr.m,v retrieving revision 1.8 diff -u -p -r1.8 zgshsr.m --- control/util/zgshsr.m 12 Oct 2007 21:27:19 -0000 1.8 +++ control/util/zgshsr.m 3 Nov 2007 21:47:05 -0000 @@ -37,7 +37,7 @@ ## Conversion to Octave by R. Bruce Tenison July 3, 1994 function x = zgshsr (y) - + if ( nargin != 1 ), print_usage(); endif if (! isvector (y)) error (sprintf ("y(%dx%d) must be a vector", rows (y), columns (y))); endif Index: general/isa.m =================================================================== RCS file: /cvs/octave/scripts/general/isa.m,v retrieving revision 1.5 diff -u -p -r1.5 isa.m --- general/isa.m 12 Oct 2007 21:27:21 -0000 1.5 +++ general/isa.m 3 Nov 2007 21:47:05 -0000 @@ -25,5 +25,6 @@ ## Adapted-by: jwe function retval = isa (x, cname) + if ( nargin != 2 ), print_usage (); endif retval = strcmp (class (x), cname); endfunction Index: geometry/inpolygon.m =================================================================== RCS file: /cvs/octave/scripts/geometry/inpolygon.m,v retrieving revision 1.3 diff -u -p -r1.3 inpolygon.m --- geometry/inpolygon.m 12 Oct 2007 21:27:22 -0000 1.3 +++ geometry/inpolygon.m 3 Nov 2007 21:47:05 -0000 @@ -37,7 +37,7 @@ ## credited to Randolph Franklin. function [IN, ON] = inpolygon (X, Y, xv, yv) - + if ( nargin != 4 ), print_usage (); endif if ( !(isreal(X) && isreal(Y) && ismatrix(Y) && ... ismatrix(Y) && size_equal(X,Y)) ) error ("inpolygon: first two arguments must be real matrices of same size"); Index: linear-algebra/housh.m =================================================================== RCS file: /cvs/octave/scripts/linear-algebra/housh.m,v retrieving revision 1.9 diff -u -p -r1.9 housh.m --- linear-algebra/housh.m 12 Oct 2007 21:27:22 -0000 1.9 +++ linear-algebra/housh.m 3 Nov 2007 21:47:05 -0000 @@ -34,7 +34,7 @@ ## Created: August 1995 function [housv, beta, zer] = housh (x, j, z) - + if ( nargin != 3 ), print_usage (); endif ## check for valid inputs if (!isvector (x) && ! isscalar (x)) error ("housh: first input must be a vector") Index: miscellaneous/compare_versions.m =================================================================== RCS file: /cvs/octave/scripts/miscellaneous/compare_versions.m,v retrieving revision 1.7 diff -u -p -r1.7 compare_versions.m --- miscellaneous/compare_versions.m 25 Oct 2007 07:16:07 -0000 1.7 +++ miscellaneous/compare_versions.m 3 Nov 2007 21:47:05 -0000 @@ -69,7 +69,7 @@ ## we want to require a double equal since that is the boolean operator? function out = compare_versions (v1, v2, operator) - +if ( nargin != 3 ), print_usage (); endif ## Make sure that the version numbers are valid. if (! (ischar (v1) && ischar (v2))) error ("compare_versions: both version numbers must be strings"); Index: miscellaneous/inputname.m =================================================================== RCS file: /cvs/octave/scripts/miscellaneous/inputname.m,v retrieving revision 1.4 diff -u -p -r1.4 inputname.m --- miscellaneous/inputname.m 12 Oct 2007 21:27:23 -0000 1.4 +++ miscellaneous/inputname.m 3 Nov 2007 21:47:06 -0000 @@ -25,6 +25,7 @@ ## @end deftypefn function s = inputname (n) + if ( nargin != 1 ), print_usage (); endif s = evalin ("caller", sprintf ("deblank (argn(%d,:));", n)); endfunction Index: miscellaneous/run.m =================================================================== RCS file: /cvs/octave/scripts/miscellaneous/run.m,v retrieving revision 1.4 diff -u -p -r1.4 run.m --- miscellaneous/run.m 12 Oct 2007 21:27:23 -0000 1.4 +++ miscellaneous/run.m 3 Nov 2007 21:47:06 -0000 @@ -29,6 +29,7 @@ ## PKG_ADD: mark_as_command run function run (s) + if ( nargin != 1 ), print_usage (); endif [d, f, ext] = fileparts (s); if (! isempty (d)) if (exist (d, "dir")) Index: quaternion/qconj.m =================================================================== RCS file: /cvs/octave/scripts/quaternion/qconj.m,v retrieving revision 1.5 diff -u -p -r1.5 qconj.m --- quaternion/qconj.m 12 Oct 2007 21:27:25 -0000 1.5 +++ quaternion/qconj.m 3 Nov 2007 21:47:06 -0000 @@ -31,7 +31,7 @@ ## Adapted-By: jwe function retval = qconj (q) - + if ( nargin != 1 ), print_usage (); endif [a, b, c, d] = quaternion (q); retval = quaternion (-a, -b, -c, d); Index: quaternion/qcoordinate_plot.m =================================================================== RCS file: /cvs/octave/scripts/quaternion/qcoordinate_plot.m,v retrieving revision 1.8 diff -u -p -r1.8 qcoordinate_plot.m --- quaternion/qcoordinate_plot.m 12 Oct 2007 21:27:25 -0000 1.8 +++ quaternion/qcoordinate_plot.m 3 Nov 2007 21:47:06 -0000 @@ -37,7 +37,7 @@ ## Adapted-By: jwe function qcoordinate_plot (qf, qb, qv) - + if ( nargin != 3 ), print_usage (); endif degrees = pi / 180; d180 = 180 * degrees; Index: quaternion/qderiv.m =================================================================== RCS file: /cvs/octave/scripts/quaternion/qderiv.m,v retrieving revision 1.6 diff -u -p -r1.6 qderiv.m --- quaternion/qderiv.m 12 Oct 2007 21:27:25 -0000 1.6 +++ quaternion/qderiv.m 3 Nov 2007 21:47:06 -0000 @@ -42,7 +42,7 @@ ## Adapted-By: jwe function Dmat = qderivmat (Omega) - + if ( nargin != 1 ), print_usage (); endif Omega = vec (Omega); if (length (Omega) != 3) Index: quaternion/qderivmat.m =================================================================== RCS file: /cvs/octave/scripts/quaternion/qderivmat.m,v retrieving revision 1.6 diff -u -p -r1.6 qderivmat.m --- quaternion/qderivmat.m 12 Oct 2007 21:27:25 -0000 1.6 +++ quaternion/qderivmat.m 3 Nov 2007 21:47:06 -0000 @@ -42,7 +42,7 @@ ## Adapted-By: jwe function Dmat = qderivmat (Omega) - + if ( nargin != 1 ), print_usage (); endif Omega = vec (Omega); if (length (Omega) != 3) Index: quaternion/qinv.m =================================================================== RCS file: /cvs/octave/scripts/quaternion/qinv.m,v retrieving revision 1.5 diff -u -p -r1.5 qinv.m --- quaternion/qinv.m 12 Oct 2007 21:27:25 -0000 1.5 +++ quaternion/qinv.m 3 Nov 2007 21:47:06 -0000 @@ -31,7 +31,7 @@ ## Adapted-By: jwe function retval = qinv (q) - + if ( nargin != 1 ), print_usage (); endif if (norm (q) != 0) retval = qconj (q) / sum (q .* q); else Index: quaternion/qmult.m =================================================================== RCS file: /cvs/octave/scripts/quaternion/qmult.m,v retrieving revision 1.5 diff -u -p -r1.5 qmult.m --- quaternion/qmult.m 12 Oct 2007 21:27:25 -0000 1.5 +++ quaternion/qmult.m 3 Nov 2007 21:47:06 -0000 @@ -40,7 +40,7 @@ ## Adapted-By: jwe function retval = qmult (a, b) - + if ( nargin != 2 ), print_usage (); endif [a1, b1, c1, d1] = quaternion (a); [a2, b2, c2, d2] = quaternion (b); Index: quaternion/qtrans.m =================================================================== RCS file: /cvs/octave/scripts/quaternion/qtrans.m,v retrieving revision 1.6 diff -u -p -r1.6 qtrans.m --- quaternion/qtrans.m 12 Oct 2007 21:27:25 -0000 1.6 +++ quaternion/qtrans.m 3 Nov 2007 21:47:06 -0000 @@ -27,7 +27,7 @@ ## Adapted-By: jwe function v = qtrans (v, q) - + if ( nargin != 2 ), print_usage (); endif if (! isvector (v) || length (v) != 4) error ("qtrans: v(%d,%d) must be a quaternion", rows (v), columns (v)); elseif (! isvector (q) || length (q) != 4) Index: quaternion/qtransvmat.m =================================================================== RCS file: /cvs/octave/scripts/quaternion/qtransvmat.m,v retrieving revision 1.8 diff -u -p -r1.8 qtransvmat.m --- quaternion/qtransvmat.m 12 Oct 2007 21:27:25 -0000 1.8 +++ quaternion/qtransvmat.m 3 Nov 2007 21:47:06 -0000 @@ -28,7 +28,7 @@ ## Adapted-By: jwe function Aib = qtransvmat (qib) - + if ( nargin != 1 ), print_usage (); endif if (! isvector(qib) || length (qib) != 4) error ("qtransvmat: q(%d,%d) must be a quaternion", rows (qib), \ columns (qib)); Index: signal/fractdiff.m =================================================================== RCS file: /cvs/octave/scripts/signal/fractdiff.m,v retrieving revision 1.10 diff -u -p -r1.10 fractdiff.m --- signal/fractdiff.m 12 Oct 2007 21:27:25 -0000 1.10 +++ signal/fractdiff.m 3 Nov 2007 21:47:06 -0000 @@ -27,6 +27,7 @@ ## Description: Compute fractional differences function retval = fractdiff (x, d) + if ( nargin !=2 ), print_usage (); endif N = 100; Index: signal/freqz_plot.m =================================================================== RCS file: /cvs/octave/scripts/signal/freqz_plot.m,v retrieving revision 1.13 diff -u -p -r1.13 freqz_plot.m --- signal/freqz_plot.m 12 Oct 2007 21:27:25 -0000 1.13 +++ signal/freqz_plot.m 3 Nov 2007 21:47:06 -0000 @@ -25,6 +25,8 @@ function freqz_plot (w, h) + if ( nargin != 2 ), print_usage (); endif + n = length (w); ## ## exclude zero-frequency Index: signal/periodogram.m =================================================================== RCS file: /cvs/octave/scripts/signal/periodogram.m,v retrieving revision 1.9 diff -u -p -r1.9 periodogram.m --- signal/periodogram.m 12 Oct 2007 21:27:25 -0000 1.9 +++ signal/periodogram.m 3 Nov 2007 21:47:06 -0000 @@ -28,6 +28,8 @@ function retval = periodogram (x) + if ( nargin != 1 ), print_usage (); endif + [r, c] = size(x); if (r == 1) Index: signal/rectangle_lw.m =================================================================== RCS file: /cvs/octave/scripts/signal/rectangle_lw.m,v retrieving revision 1.8 diff -u -p -r1.8 rectangle_lw.m --- signal/rectangle_lw.m 12 Oct 2007 21:27:25 -0000 1.8 +++ signal/rectangle_lw.m 3 Nov 2007 21:47:06 -0000 @@ -27,6 +27,7 @@ ## Description: Rectangular lag window function retval = rectangle_lw (n, b) + if ( nargin != 2 ), print_usage (); endif retval = zeros (n, 1); t = floor (1 / b); Index: signal/rectangle_sw.m =================================================================== RCS file: /cvs/octave/scripts/signal/rectangle_sw.m,v retrieving revision 1.8 diff -u -p -r1.8 rectangle_sw.m --- signal/rectangle_sw.m 12 Oct 2007 21:27:25 -0000 1.8 +++ signal/rectangle_sw.m 3 Nov 2007 21:47:06 -0000 @@ -27,7 +27,7 @@ ## Description: Rectangular spectral window function retval = rectangle_sw (n, b) - + if ( nargin != 2 ), print_usage (); endif retval = zeros (n, 1); retval(1) = 2 / b + 1; Index: signal/sinc.m =================================================================== RCS file: /cvs/octave/scripts/signal/sinc.m,v retrieving revision 1.13 diff -u -p -r1.13 sinc.m --- signal/sinc.m 12 Oct 2007 21:27:25 -0000 1.13 +++ signal/sinc.m 3 Nov 2007 21:47:06 -0000 @@ -33,7 +33,7 @@ ## Author: jwe ??? function result = sinc (x) - + if ( nargin != 1 ), print_usage (); endif result = ones (size (x)); i = (x != 0); Index: signal/triangle_lw.m =================================================================== RCS file: /cvs/octave/scripts/signal/triangle_lw.m,v retrieving revision 1.9 diff -u -p -r1.9 triangle_lw.m --- signal/triangle_lw.m 12 Oct 2007 21:27:26 -0000 1.9 +++ signal/triangle_lw.m 3 Nov 2007 21:47:06 -0000 @@ -27,7 +27,7 @@ ## Description: Triangular lag window function retval = triangle_lw (n, b) - + if ( nargin != 2 ), print_usage (); endif retval = 1 - (0 : n-1)' * b; retval = max ([retval'; (zeros (1, n))])'; Index: signal/triangle_sw.m =================================================================== RCS file: /cvs/octave/scripts/signal/triangle_sw.m,v retrieving revision 1.8 diff -u -p -r1.8 triangle_sw.m --- signal/triangle_sw.m 12 Oct 2007 21:27:26 -0000 1.8 +++ signal/triangle_sw.m 3 Nov 2007 21:47:06 -0000 @@ -27,7 +27,7 @@ ## Description: Triangular spectral window function retval = triangle_sw (n, b) - + if ( nargin !=2 ), print_usage (); endif retval = zeros(n,1); retval(1) = 1 / b; Index: signal/yulewalker.m =================================================================== RCS file: /cvs/octave/scripts/signal/yulewalker.m,v retrieving revision 1.8 diff -u -p -r1.8 yulewalker.m --- signal/yulewalker.m 12 Oct 2007 21:27:26 -0000 1.8 +++ signal/yulewalker.m 3 Nov 2007 21:47:06 -0000 @@ -30,7 +30,7 @@ ## Description: Fit AR model by Yule-Walker method function [a, v] = yulewalker (c) - + if ( nargin != 1 ), print_usage (); endif p = length (c) - 1; if (columns (c) > 1) Index: sparse/colperm.m =================================================================== RCS file: /cvs/octave/scripts/sparse/colperm.m,v retrieving revision 1.5 diff -u -p -r1.5 colperm.m --- sparse/colperm.m 12 Oct 2007 21:27:26 -0000 1.5 +++ sparse/colperm.m 3 Nov 2007 21:47:06 -0000 @@ -26,6 +26,7 @@ ## @end deftypefn function p = colperm (s) + if ( nargin != 1 ), print_usage (); endif [i, j] = spfind (s); idx = find (diff ([j; Inf]) != 0); [dummy, p] = sort (idx - [0; idx(1:(end-1))]); Index: sparse/etreeplot.m =================================================================== RCS file: /cvs/octave/scripts/sparse/etreeplot.m,v retrieving revision 1.5 diff -u -p -r1.5 etreeplot.m --- sparse/etreeplot.m 12 Oct 2007 21:27:26 -0000 1.5 +++ sparse/etreeplot.m 3 Nov 2007 21:47:06 -0000 @@ -27,5 +27,6 @@ ## @end deftypefn function etreeplot (s, varargin) + if ( nargin < 1 ), print_usage (); endif treeplot (etree (s+s'), varargin{:}); endfunction Index: sparse/nonzeros.m =================================================================== RCS file: /cvs/octave/scripts/sparse/nonzeros.m,v retrieving revision 1.5 diff -u -p -r1.5 nonzeros.m --- sparse/nonzeros.m 12 Oct 2007 21:27:26 -0000 1.5 +++ sparse/nonzeros.m 3 Nov 2007 21:47:06 -0000 @@ -22,6 +22,7 @@ ## @end deftypefn function t = nonzeros (s) + if ( nargin != 1 ), print_usage (); endif if (issparse (s)) [i, j, t] = spfind (s); else Index: sparse/spalloc.m =================================================================== RCS file: /cvs/octave/scripts/sparse/spalloc.m,v retrieving revision 1.7 diff -u -p -r1.7 spalloc.m --- sparse/spalloc.m 12 Oct 2007 21:27:26 -0000 1.7 +++ sparse/spalloc.m 3 Nov 2007 21:47:06 -0000 @@ -41,5 +41,6 @@ ## @end deftypefn function s = spalloc (r, c, nz) + if ( nargin <2 ), print_usage (); endif s = sparse (r, c); endfunction Index: sparse/spones.m =================================================================== RCS file: /cvs/octave/scripts/sparse/spones.m,v retrieving revision 1.6 diff -u -p -r1.6 spones.m --- sparse/spones.m 12 Oct 2007 21:27:26 -0000 1.6 +++ sparse/spones.m 3 Nov 2007 21:47:06 -0000 @@ -23,6 +23,7 @@ ## @end deftypefn function s = spones (s) + if ( nargin !=1 ), print_usage (); endif if (issparse (s)) [i, j, v, m, n] = spfind (s); else Index: sparse/spy.m =================================================================== RCS file: /cvs/octave/scripts/sparse/spy.m,v retrieving revision 1.12 diff -u -p -r1.12 spy.m --- sparse/spy.m 12 Oct 2007 21:27:26 -0000 1.12 +++ sparse/spy.m 3 Nov 2007 21:47:06 -0000 @@ -29,7 +29,7 @@ ## @end deftypefn function spy (S, varargin) - + if ( nargin < 1 ), print_usage (); endif markersize = NaN; if (numel (i) < 1000) LineSpec = "*"; Index: specfun/isprime.m =================================================================== RCS file: /cvs/octave/scripts/specfun/isprime.m,v retrieving revision 1.3 diff -u -p -r1.3 isprime.m --- specfun/isprime.m 12 Oct 2007 21:27:26 -0000 1.3 +++ specfun/isprime.m 3 Nov 2007 21:47:06 -0000 @@ -35,6 +35,11 @@ ## @end deftypefn function t = isprime (n) + + if (nargin < 1) + print_usage (); + endif + if (! isscalar (n)) nel = numel (n); t = n; Index: statistics/distributions/empirical_cdf.m =================================================================== RCS file: /cvs/octave/scripts/statistics/distributions/empirical_cdf.m,v retrieving revision 1.9 diff -u -p -r1.9 empirical_cdf.m --- statistics/distributions/empirical_cdf.m 12 Oct 2007 21:27:27 -0000 1.9 +++ statistics/distributions/empirical_cdf.m 3 Nov 2007 21:47:06 -0000 @@ -27,7 +27,7 @@ ## Description: CDF of the empirical distribution function cdf = empirical_cdf (x, data) - + if ( nargin !=2 ), print_usage (); endif if (! isvector (data)) error ("empirical_cdf: data must be a vector"); endif Index: statistics/distributions/empirical_inv.m =================================================================== RCS file: /cvs/octave/scripts/statistics/distributions/empirical_inv.m,v retrieving revision 1.9 diff -u -p -r1.9 empirical_inv.m --- statistics/distributions/empirical_inv.m 12 Oct 2007 21:27:27 -0000 1.9 +++ statistics/distributions/empirical_inv.m 3 Nov 2007 21:47:06 -0000 @@ -27,7 +27,7 @@ ## Description: Quantile function of the empirical distribution function inv = empirical_inv (x, data) - + if ( nargin !=2 ), print_usage (); endif if (! isvector (data)) error ("empirical_inv: data must be a vector"); endif Index: statistics/distributions/empirical_pdf.m =================================================================== RCS file: /cvs/octave/scripts/statistics/distributions/empirical_pdf.m,v retrieving revision 1.9 diff -u -p -r1.9 empirical_pdf.m --- statistics/distributions/empirical_pdf.m 12 Oct 2007 21:27:27 -0000 1.9 +++ statistics/distributions/empirical_pdf.m 3 Nov 2007 21:47:06 -0000 @@ -27,7 +27,7 @@ ## Description: PDF of the empirical distribution function pdf = empirical_pdf (x, data) - + if ( nargin !=2 ), print_usage (); endif if (! isvector (data)) error ("empirical_pdf: data must be a vector"); endif Index: statistics/models/logistic_regression_derivatives.m =================================================================== RCS file: /cvs/octave/scripts/statistics/models/logistic_regression_derivatives.m,v retrieving revision 1.10 diff -u -p -r1.10 logistic_regression_derivatives.m --- statistics/models/logistic_regression_derivatives.m 12 Oct 2007 21:27:28 -0000 1.10 +++ statistics/models/logistic_regression_derivatives.m 3 Nov 2007 21:47:07 -0000 @@ -28,7 +28,7 @@ ## Description: Derivates of log-likelihood in logistic regression function [dl, d2l] = logistic_regression_derivatives (x, z, z1, g, g1, p) - + if ( nargin !=6 ), print_usage (); endif ## first derivative v = g .* (1 - g) ./ p; v1 = g1 .* (1 - g1) ./ p; dlogp = [(dmult (v, z) - dmult (v1, z1)), (dmult (v - v1, x))]; @@ -39,4 +39,4 @@ function [dl, d2l] = logistic_regression d2l = [z, x]' * dmult (w, [z, x]) - [z1, x]' * dmult (w1, [z1, x]) ... - dlogp' * dlogp; -endfunction \ No newline at end of file +endfunction Index: statistics/models/logistic_regression_likelihood.m =================================================================== RCS file: /cvs/octave/scripts/statistics/models/logistic_regression_likelihood.m,v retrieving revision 1.10 diff -u -p -r1.10 logistic_regression_likelihood.m --- statistics/models/logistic_regression_likelihood.m 12 Oct 2007 21:27:28 -0000 1.10 +++ statistics/models/logistic_regression_likelihood.m 3 Nov 2007 21:47:07 -0000 @@ -28,7 +28,7 @@ ## Description: Likelihood in logistic regression function [g, g1, p, dev] = logistic_regression_likelihood (y, x, beta, z, z1) - + if ( nargin !=5 ), print_usage (); endif e = exp ([z, x] * beta); e1 = exp ([z1, x] * beta); g = e ./ (1 + e); g1 = e1 ./ (1 + e1); g = max (y == max (y), g); g1 = min (y > min(y), g1);