Mercurial > hg > octave-lyh
changeset 6046:34f96dd5441b
[project @ 2006-10-10 16:10:25 by jwe]
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,8 +1,256 @@ +2006-10-10 Bill Denney <denney@seas.upenn.edu> + + * audio/lin2mu.m, audio/loadaudio.m, audio/mu2lin.m, + audio/playaudio.m, audio/record.m, audio/saveaudio.m, + audio/setaudio.m, audio/wavread.m, audio/wavwrite.m, + control/base/__bodquist__.m, control/base/__freqresp__.m, + control/base/are.m, control/base/bode.m, control/base/ctrb.m, + control/base/damp.m, control/base/dare.m, control/base/dcgain.m, + control/base/dre.m, control/base/impulse.m, control/base/lqg.m, + control/base/lsim.m, control/base/lyap.m, control/base/nichols.m, + control/base/nyquist.m, control/base/obsv.m, control/base/pzmap.m, + control/base/rlocus.m, control/base/step.m, control/base/tzero.m, + control/hinf/h2norm.m, control/hinf/h2syn.m, + control/hinf/hinfnorm.m, control/hinf/hinfsyn.m, + control/hinf/is_dgkf.m, control/hinf/wgt1o.m, + control/obsolete/dezero.m, control/system/__sysdefioname__.m, + control/system/buildssic.m, control/system/c2d.m, + control/system/cellidx.m, control/system/d2c.m, + control/system/dmr2d.m, control/system/fir2sys.m, + control/system/is_abcd.m, control/system/is_controllable.m, + control/system/is_detectable.m, control/system/is_digital.m, + control/system/is_observable.m, control/system/is_siso.m, + control/system/is_stabilizable.m, control/system/is_stable.m, + control/system/jet707.m, control/system/listidx.m, + control/system/ord2.m, control/system/parallel.m, + control/system/ss.m, control/system/ss2zp.m, + control/system/starp.m, control/system/sys2ss.m, + control/system/sys2tf.m, control/system/sys2zp.m, + control/system/sysadd.m, control/system/sysappend.m, + control/system/syschtsam.m, control/system/sysconnect.m, + control/system/syscont.m, control/system/sysdimensions.m, + control/system/sysdisc.m, control/system/sysdup.m, + control/system/sysgetsignals.m, control/system/sysgettsam.m, + control/system/sysgroup.m, control/system/sysidx.m, + control/system/sysmin.m, control/system/sysmult.m, + control/system/sysout.m, control/system/sysprune.m, + control/system/sysscale.m, control/system/syssetsignals.m, + control/system/syssub.m, control/system/sysupdate.m, + control/system/tf.m, control/system/tfout.m, + control/system/ugain.m, control/system/zp.m, + control/system/zpout.m, control/util/__outlist__.m, + control/util/__zgpbal__.m, control/util/prompt.m, + control/util/sortcom.m, control/util/strappend.m, + deprecated/com2str.m, elfun/acot.m, elfun/acoth.m, elfun/acsc.m, + elfun/acsch.m, elfun/asec.m, elfun/asech.m, elfun/cot.m, + elfun/coth.m, elfun/csc.m, elfun/csch.m, elfun/lcm.m, elfun/sec.m, + elfun/sech.m, finance/fv.m, finance/fvl.m, finance/irr.m, + finance/nper.m, finance/npv.m, finance/pmt.m, finance/pv.m, + finance/pvl.m, finance/rate.m, finance/vol.m, + general/__isequal__.m, general/bitcmp.m, general/bitget.m, + general/bitset.m, general/blkdiag.m, general/cart2sph.m, + general/cell2mat.m, general/circshift.m, general/cplxpair.m, + general/cumtrapz.m, general/deal.m, general/diff.m, + general/flipdim.m, general/fliplr.m, general/flipud.m, + general/ind2sub.m, general/int2str.m, + general/is_duplicate_entry.m, general/isdefinite.m, + general/isequal.m, general/isequalwithequalnans.m, + general/isscalar.m, general/issquare.m, general/issymmetric.m, + general/isvector.m, general/logical.m, general/logspace.m, + general/mod.m, general/nargchk.m, general/nextpow2.m, + general/perror.m, general/postpad.m, general/prepad.m, + general/randperm.m, general/rem.m, general/repmat.m, + general/rot90.m, general/rotdim.m, general/shift.m, + general/shiftdim.m, general/sph2cart.m, general/strerror.m, + general/sub2ind.m, general/trapz.m, general/tril.m, + general/triu.m, image/gray.m, image/gray2ind.m, image/hsv2rgb.m, + image/image.m, image/imagesc.m, image/ind2gray.m, image/ind2rgb.m, + image/loadimage.m, image/ntsc2rgb.m, image/ocean.m, + image/rgb2hsv.m, image/rgb2ntsc.m, image/saveimage.m, io/beep.m, + linear-algebra/commutation_matrix.m, linear-algebra/cond.m, + linear-algebra/cross.m, linear-algebra/dmult.m, + linear-algebra/dot.m, linear-algebra/duplication_matrix.m, + linear-algebra/krylov.m, linear-algebra/krylovb.m, + linear-algebra/logm.m, linear-algebra/norm.m, + linear-algebra/null.m, linear-algebra/orth.m, + linear-algebra/qzhess.m, linear-algebra/rank.m, + linear-algebra/trace.m, linear-algebra/vec.m, + linear-algebra/vech.m, miscellaneous/bincoeff.m, + miscellaneous/delete.m, miscellaneous/dir.m, miscellaneous/dos.m, + miscellaneous/fileattrib.m, miscellaneous/fileparts.m, + miscellaneous/flops.m, miscellaneous/fullfile.m, + miscellaneous/ispc.m, miscellaneous/isunix.m, + miscellaneous/menu.m, miscellaneous/not.m, miscellaneous/popen2.m, + miscellaneous/single.m, miscellaneous/unix.m, miscellaneous/ver.m, + miscellaneous/xor.m, optimization/glpk.m, optimization/glpkmex.m, + optimization/qp.m, optimization/sqp.m, plot/__axis_label__.m, + plot/__errplot__.m, plot/__plr1__.m, plot/__plr2__.m, + plot/__plr__.m, plot/__plt1__.m, plot/__plt2__.m, + plot/__plt2mm__.m, plot/__plt2mv__.m, plot/__plt2ss__.m, + plot/__plt2vm__.m, plot/__plt2vv__.m, plot/__pltopt1__.m, + plot/__pltopt__.m, plot/bar.m, plot/bottom_title.m, plot/close.m, + plot/contour.m, plot/errorbar.m, plot/figure.m, plot/fplot.m, + plot/grid.m, plot/hist.m, plot/hold.m, plot/ishold.m, + plot/loglogerr.m, plot/mesh.m, plot/meshdom.m, plot/meshgrid.m, + plot/multiplot.m, plot/orient.m, plot/polar.m, plot/replot.m, + plot/semilogxerr.m, plot/semilogyerr.m, plot/sombrero.m, + plot/stairs.m, plot/subplot.m, plot/subwindow.m, plot/title.m, + plot/top_title.m, polynomial/compan.m, polynomial/conv.m, + polynomial/deconv.m, polynomial/mkpp.m, polynomial/poly.m, + polynomial/polyder.m, polynomial/polyderiv.m, + polynomial/polyfit.m, polynomial/polygcd.m, + polynomial/polyinteg.m, polynomial/polyout.m, + polynomial/polyreduce.m, polynomial/polyval.m, + polynomial/polyvalm.m, polynomial/ppval.m, polynomial/residue.m, + polynomial/roots.m, polynomial/unmkpp.m, quaternion/quaternion.m, + set/complement.m, set/create_set.m, set/intersect.m, + set/ismember.m, set/setdiff.m, set/setxor.m, set/union.m, + set/unique.m, signal/arch_fit.m, signal/arch_rnd.m, + signal/arma_rnd.m, signal/autocor.m, signal/autoreg_matrix.m, + signal/bartlett.m, signal/blackman.m, signal/detrend.m, + signal/diffpara.m, signal/durbinlevinson.m, signal/fftconv.m, + signal/fftfilt.m, signal/fftshift.m, signal/filter2.m, + signal/freqz.m, signal/hamming.m, signal/hanning.m, + signal/hurst.m, signal/ifftshift.m, signal/sinetone.m, + signal/sinewave.m, signal/spencer.m, signal/stft.m, + signal/synthesis.m, signal/unwrap.m, sparse/gplot.m, + sparse/spfun.m, sparse/sprand.m, sparse/sprandn.m, + sparse/sprandsym.m, sparse/spstats.m, specfun/beta.m, + specfun/betai.m, specfun/betaln.m, specfun/erfinv.m, + specfun/gammai.m, specfun/log2.m, specfun/pow2.m, + special-matrix/hankel.m, special-matrix/hilb.m, + special-matrix/invhilb.m, special-matrix/sylvester_matrix.m, + special-matrix/toeplitz.m, special-matrix/vander.m, + statistics/base/center.m, statistics/base/cloglog.m, + statistics/base/cor.m, statistics/base/corrcoef.m, + statistics/base/cov.m, statistics/base/cut.m, + statistics/base/gls.m, statistics/base/iqr.m, + statistics/base/kendall.m, statistics/base/kurtosis.m, + statistics/base/logit.m, statistics/base/mahalanobis.m, + statistics/base/mean.m, statistics/base/meansq.m, + statistics/base/median.m, statistics/base/moment.m, + statistics/base/ols.m, statistics/base/ppplot.m, + statistics/base/probit.m, statistics/base/qqplot.m, + statistics/base/range.m, statistics/base/ranks.m, + statistics/base/run_count.m, statistics/base/skewness.m, + statistics/base/spearman.m, statistics/base/statistics.m, + statistics/base/std.m, statistics/base/studentize.m, + statistics/base/table.m, statistics/base/values.m, + statistics/base/var.m, statistics/distributions/betacdf.m, + statistics/distributions/betainv.m, + statistics/distributions/betapdf.m, + statistics/distributions/betarnd.m, + statistics/distributions/binocdf.m, + statistics/distributions/binoinv.m, + statistics/distributions/binopdf.m, + statistics/distributions/binornd.m, + statistics/distributions/cauchy_cdf.m, + statistics/distributions/cauchy_inv.m, + statistics/distributions/cauchy_pdf.m, + statistics/distributions/cauchy_rnd.m, + statistics/distributions/chi2cdf.m, + statistics/distributions/chi2inv.m, + statistics/distributions/chi2pdf.m, + statistics/distributions/chi2rnd.m, + statistics/distributions/discrete_cdf.m, + statistics/distributions/discrete_inv.m, + statistics/distributions/discrete_pdf.m, + statistics/distributions/discrete_rnd.m, + statistics/distributions/empirical_rnd.m, + statistics/distributions/expcdf.m, + statistics/distributions/expinv.m, + statistics/distributions/exppdf.m, + statistics/distributions/exprnd.m, + statistics/distributions/fcdf.m, statistics/distributions/finv.m, + statistics/distributions/fpdf.m, statistics/distributions/frnd.m, + statistics/distributions/gamcdf.m, + statistics/distributions/gaminv.m, + statistics/distributions/gampdf.m, + statistics/distributions/gamrnd.m, + statistics/distributions/geocdf.m, + statistics/distributions/geoinv.m, + statistics/distributions/geopdf.m, + statistics/distributions/geornd.m, + statistics/distributions/hygecdf.m, + statistics/distributions/hygeinv.m, + statistics/distributions/hygepdf.m, + statistics/distributions/hygernd.m, + statistics/distributions/kolmogorov_smirnov_cdf.m, + statistics/distributions/laplace_cdf.m, + statistics/distributions/laplace_inv.m, + statistics/distributions/laplace_pdf.m, + statistics/distributions/laplace_rnd.m, + statistics/distributions/logistic_cdf.m, + statistics/distributions/logistic_inv.m, + statistics/distributions/logistic_pdf.m, + statistics/distributions/logistic_rnd.m, + statistics/distributions/logncdf.m, + statistics/distributions/logninv.m, + statistics/distributions/lognpdf.m, + statistics/distributions/lognrnd.m, + statistics/distributions/normcdf.m, + statistics/distributions/norminv.m, + statistics/distributions/normpdf.m, + statistics/distributions/normrnd.m, + statistics/distributions/pascal_cdf.m, + statistics/distributions/pascal_inv.m, + statistics/distributions/pascal_pdf.m, + statistics/distributions/pascal_rnd.m, + statistics/distributions/poisscdf.m, + statistics/distributions/poissinv.m, + statistics/distributions/poisspdf.m, + statistics/distributions/poissrnd.m, + statistics/distributions/stdnormal_cdf.m, + statistics/distributions/stdnormal_inv.m, + statistics/distributions/stdnormal_pdf.m, + statistics/distributions/stdnormal_rnd.m, + statistics/distributions/tcdf.m, statistics/distributions/tinv.m, + statistics/distributions/tpdf.m, statistics/distributions/trnd.m, + statistics/distributions/unifcdf.m, + statistics/distributions/unifinv.m, + statistics/distributions/unifpdf.m, + statistics/distributions/unifrnd.m, + statistics/distributions/wblcdf.m, + statistics/distributions/wblinv.m, + statistics/distributions/wblpdf.m, + statistics/distributions/wblrnd.m, + statistics/distributions/wienrnd.m, statistics/tests/anova.m, + statistics/tests/bartlett_test.m, + statistics/tests/chisquare_test_homogeneity.m, + statistics/tests/chisquare_test_independence.m, + statistics/tests/cor_test.m, statistics/tests/f_test_regression.m, + statistics/tests/hotelling_test.m, + statistics/tests/hotelling_test_2.m, + statistics/tests/kolmogorov_smirnov_test.m, + statistics/tests/kolmogorov_smirnov_test_2.m, + statistics/tests/kruskal_wallis_test.m, statistics/tests/manova.m, + statistics/tests/mcnemar_test.m, statistics/tests/prop_test_2.m, + statistics/tests/run_test.m, statistics/tests/sign_test.m, + statistics/tests/t_test.m, statistics/tests/t_test_2.m, + statistics/tests/t_test_regression.m, statistics/tests/u_test.m, + statistics/tests/var_test.m, statistics/tests/welch_test.m, + statistics/tests/wilcoxon_test.m, statistics/tests/z_test.m, + statistics/tests/z_test_2.m, strings/base2dec.m, strings/blanks.m, + strings/deblank.m, strings/dec2base.m, strings/dec2bin.m, + strings/dec2hex.m, strings/findstr.m, strings/hex2dec.m, + strings/index.m, strings/isletter.m, strings/lower.m, + strings/rindex.m, strings/split.m, strings/str2mat.m, + strings/str2num.m, strings/strcat.m, strings/strcmpi.m, + strings/strfind.m, strings/strjust.m, strings/strmatch.m, + strings/strncmp.m, strings/strncmpi.m, strings/strrep.m, + strings/strtrunc.m, strings/strvcat.m, strings/substr.m, + strings/upper.m, testfun/assert.m, testfun/demo.m, + testfun/example.m, testfun/fail.m, testfun/speed.m, + testfun/test.m, time/asctime.m, time/calendar.m, time/ctime.m, + time/datenum.m, time/datestr.m, time/datevec.m, time/eomday.m, + time/etime.m, time/is_leap_year.m: + Use print_usage instead of usage. + 2006-10-09 David Bateman <dbateman@free.fr> * time/datevec.m: Add additional compatible default parsing strings. -2006-10-09 Bill Denney <denney@seas.upenn.edu> +2006-10-09 Bill Denney <denney@seas.upenn.edu>< * pkg/pkg.m: Remove trailing "\n" from error messages. Remove compare_versions subfunction.
--- a/scripts/audio/lin2mu.m +++ b/scripts/audio/lin2mu.m @@ -49,7 +49,7 @@ error ("lin2mu: bit must be either 0, 8 or 16"); endif else - usage ("y = lin2mu (x, bit)"); + print_usage (); endif ## Transform real and n-bit format to 16-bit.
--- a/scripts/audio/loadaudio.m +++ b/scripts/audio/loadaudio.m @@ -40,7 +40,7 @@ function X = loadaudio (name, ext, bit) if (nargin == 0 || nargin > 3) - usage ("loadaudio (name, ext, bit)"); + print_usage (); endif if (nargin == 1)
--- a/scripts/audio/mu2lin.m +++ b/scripts/audio/mu2lin.m @@ -40,7 +40,7 @@ error ("mu2lin: bit must be either 0, 8 or 16"); endif else - usage ("y = mu2lin (x, bit)"); + print_usage (); endif ulaw = [32124, 31100, 30076, 29052, 28028, 27004, 25980, 24956, \
--- a/scripts/audio/playaudio.m +++ b/scripts/audio/playaudio.m @@ -31,8 +31,6 @@ function playaudio (name, ext) - usage_msg = "playaudio (name, ext) or playaudio (X)"; - if (nargin == 1 && isvector (name) && ! ischar (name)) ## play a vector [nr, nc] = size (name); @@ -61,7 +59,7 @@ elseif (nargin == 2) name = [name, ".", ext]; else - usage (usage_msg); + print_usage (); endif if (strcmp (ext, "lin") || strcmp (ext, "raw")) system (sprintf ("cat \"%s\" > /dev/dsp", name)); @@ -72,7 +70,7 @@ error ("playaudio does not support given extension"); endif else - usage (usage_msg); + print_usage (); endif endfunction
--- a/scripts/audio/record.m +++ b/scripts/audio/record.m @@ -35,7 +35,7 @@ if (nargin == 1) sampling_rate = 8000; elseif (nargin != 2) - usage ("X = record (sec [, sampling_rate])"); + print_usage (); endif unwind_protect
--- a/scripts/audio/saveaudio.m +++ b/scripts/audio/saveaudio.m @@ -34,7 +34,7 @@ function saveaudio (name, X, ext, bit) if (nargin < 2 || nargin > 4) - usage ("saveaudio (X, name, ext, bit)"); + print_usage (); endif if (nargin == 2)
--- a/scripts/audio/setaudio.m +++ b/scripts/audio/setaudio.m @@ -35,7 +35,7 @@ elseif (nargin == 2) system (sprintf ("mixer %s %d", w_type, value)); else - usage ("setaudio (w_type, value)"); + print_usage (); endif endfunction
--- a/scripts/audio/wavread.m +++ b/scripts/audio/wavread.m @@ -49,7 +49,7 @@ BYTEORDER = "ieee-le"; if (nargin < 1 || nargin > 2) - usage ("wavread (filename, param)"); + print_usage (); endif if (! ischar (filename))
--- a/scripts/audio/wavwrite.m +++ b/scripts/audio/wavwrite.m @@ -39,7 +39,7 @@ BYTEORDER = "ieee-le"; if (nargin < 2 || nargin > 4) - usage ("wavwrite (filename, y, samples_per_sec, bits_per_sample)"); + print_usage (); endif ## parse arguments
--- a/scripts/control/base/__bodquist__.m +++ b/scripts/control/base/__bodquist__.m @@ -55,7 +55,7 @@ ## check number of input arguments given if (nargin != 5) - usage ("[f, w] = __bodquist__ (sys, w, outputs, inputs, rname)"); + print_usage (); endif ## check each argument to see if it's in the correct form
--- a/scripts/control/base/__freqresp__.m +++ b/scripts/control/base/__freqresp__.m @@ -49,7 +49,7 @@ ## Check Args if ((nargin < 2) || (nargin > 4)) - usage ("[ff, w] = __freqresp__ (sys, USEW, w)"); + print_usage (); elseif (USEW & (nargin < 3) ) error ("USEW = 1 but w was not passed."); elseif (USEW & isempty(w))
--- a/scripts/control/base/are.m +++ b/scripts/control/base/are.m @@ -115,7 +115,7 @@ n2 = 2 * n; x = u (n1:n2, 1:n) / u (1:n, 1:n); else - usage ("x = are (a, b, c)") + print_usage (); endif endfunction
--- a/scripts/control/base/bode.m +++ b/scripts/control/base/bode.m @@ -109,7 +109,7 @@ ## check number of input arguments given if (nargin < 1 | nargin > 5) - usage("[mag,phase,w] = bode(sys[,w,outputs,inputs,plot_style])"); + print_usage (); endif if(nargin < 2) w = [];
--- a/scripts/control/base/ctrb.m +++ b/scripts/control/base/ctrb.m @@ -52,7 +52,7 @@ sysupdate(sys,"ss"); [a,b] = sys2ss(sys); else - usage("ctrb(sys [, b])") + print_usage (); endif if (!is_abcd(a,b))
--- a/scripts/control/base/damp.m +++ b/scripts/control/base/damp.m @@ -36,7 +36,7 @@ ## assume a continuous system DIGITAL = 0; if(nargin < 1 || nargin > 2) - usage("damp(p,[ tsamp])") + print_usage (); endif if(isstruct(p)) if (nargin != 1)
--- a/scripts/control/base/dare.m +++ b/scripts/control/base/dare.m @@ -119,7 +119,7 @@ n2 = 2*n; x = u (n1:n2, 1:n)/u(1:n, 1:n); else - usage ("x = dare (a, b, q, r {,opt})"); + print_usage (); endif endfunction
--- a/scripts/control/base/dcgain.m +++ b/scripts/control/base/dcgain.m @@ -31,7 +31,7 @@ function gm = dcgain (sys, tol) if((nargin < 1) || (nargin > 2) || (nargout > 1)) - usage("[gm, ok] = dcgain(sys[, tol])"); + print_usage (); endif if(!isstruct(sys)) error("dcgain: first argument is not a system data structure.")
--- a/scripts/control/base/dre.m +++ b/scripts/control/base/dre.m @@ -98,7 +98,7 @@ function [tvals, Plist] = dre (sys, Q, R, Qf, t0, tf, Ptol, maxits) if(nargin < 6 | nargin > 8 | nargout != 2) - usage("[tvals,Plist] = dre(sys,Q,R,Qf,t0,tf{,Ptol})"); + print_usage (); elseif(!isstruct(sys)) error("sys must be a system data structure") elseif(is_digital(sys))
--- a/scripts/control/base/impulse.m +++ b/scripts/control/base/impulse.m @@ -57,11 +57,11 @@ function [y, t] = impulse (sys, inp, tstop, n) if ((nargin < 1) || (nargin > 4)) - usage ("[y, u] = impulse (sys, inp, tstop, n)"); + print_usage (); endif if (nargout > 2) - usage ("[y, u] = impulse (sys, inp, tstop, n)"); + print_usage (); endif if (! isstruct (sys))
--- a/scripts/control/base/lqg.m +++ b/scripts/control/base/lqg.m @@ -71,7 +71,7 @@ function [K, Q1, P1, Ee, Er] = lqg (sys, Sigw, Sigv, Q, R, input_list) if ( (nargin < 5) | (nargin > 6)) - usage("[K,Q1,P1,Ee,Er] = lqg(sys,Sigw, Sigv,Q,R{,input_list})"); + print_usage (); elseif(!isstruct(sys) ) error("sys must be in system data structure");
--- a/scripts/control/base/lsim.m +++ b/scripts/control/base/lsim.m @@ -41,7 +41,7 @@ function [y, x] = lsim (sys, u, t, x0) if((nargin < 3)||(nargin > 4)) - usage("[y,x] = lsim(sys,u,t[,x0])"); + print_usage (); endif if(!isstruct(sys))
--- a/scripts/control/base/lyap.m +++ b/scripts/control/base/lyap.m @@ -83,7 +83,7 @@ function x = lyap (a, b, c) if (nargin != 3 && nargin != 2) - usage ("lyap (a, b {,c})"); + print_usage (); endif if ((n = issquare(a)) == 0)
--- a/scripts/control/base/nichols.m +++ b/scripts/control/base/nichols.m @@ -86,7 +86,7 @@ ## check number of input arguments given if (nargin < 1 | nargin > 4) - usage("[mag,phase,w] = nichols(sys[,w,outputs,inputs])"); + print_usage (); endif if(nargin < 2) w = [];
--- a/scripts/control/base/nyquist.m +++ b/scripts/control/base/nyquist.m @@ -106,7 +106,7 @@ ## check number of input arguments given if (nargin < 1 | nargin > 5) - usage("[realp,imagp,w] = nyquist(sys[,w,outputs,inputs,atol])"); + print_usage (); endif if(nargin < 2) w = [];
--- a/scripts/control/base/obsv.m +++ b/scripts/control/base/obsv.m @@ -58,7 +58,7 @@ sysupdate(sys,"ss"); [a,b,c] = sys2ss(sys); else - usage("obsv(sys [, c])") + print_usage (); endif if (!is_abcd(a,c'))
--- a/scripts/control/base/pzmap.m +++ b/scripts/control/base/pzmap.m @@ -40,7 +40,7 @@ function [zer, pol]=pzmap (sys) if(nargin != 1) - usage("pzmap(sys) or [zer,pol] = pzmap(sys)"); + print_usage (); elseif (!isstruct(sys)); error("sys must be in system format"); endif
--- a/scripts/control/base/rlocus.m +++ b/scripts/control/base/rlocus.m @@ -69,7 +69,7 @@ function [rldata, k_break, rlpol, gvec, real_ax_pts] = rlocus (sys, increment, min_k, max_k) if (nargin < 1) | (nargin > 4) - usage("rlocus(sys[,inc,mink,maxk])"); + print_usage (); endif ## Convert the input to a transfer function if necessary
--- a/scripts/control/base/step.m +++ b/scripts/control/base/step.m @@ -58,11 +58,11 @@ function [y, t] = step (sys, inp, tstop, n) if ((nargin < 1) || (nargin > 4)) - usage ("[y, u] = step(sys, inp, tstop, n)"); + print_usage (); endif if (nargout > 2) - usage ("[y, u] = step (sys, inp, tstop, n)"); + print_usage (); endif if (! isstruct (sys))
--- a/scripts/control/base/tzero.m +++ b/scripts/control/base/tzero.m @@ -73,9 +73,9 @@ if(nargin == 4) Asys = ss(A,B,C,D); elseif( (nargin == 1) && (! isstruct(A))) - usage("[zer,gain] = tzero(A,B,C,D) or zer = tzero(Asys)"); + print_usage (); elseif(nargin != 1) - usage("[zer,gain] = tzero(A,B,C,D) or zer = tzero(Asys)"); + print_usage (); else Asys = A; [A,B,C,D] = sys2ss(Asys);
--- a/scripts/control/hinf/h2norm.m +++ b/scripts/control/hinf/h2norm.m @@ -50,7 +50,7 @@ function h2gain = h2norm (sys) if((nargin != 1)) - usage("h2gain = h2norm(sys)"); + print_usage (); elseif(!isstruct(sys)) error("Sys must be in system data structure"); end
--- a/scripts/control/hinf/h2syn.m +++ b/scripts/control/hinf/h2syn.m @@ -80,7 +80,7 @@ function [K, gain, Kc, Kf, Pc, Pf] = h2syn (Asys, nu, ny, tol) if ((nargin < 3) | (nargin > 4)) - usage("[K,gain, Kc, Kf, Pc, Pf] = h2syn(Asys,nu,ny[,tol])"); + print_usage (); elseif(nargin == 3 ) [chkdgkf,dgs] = is_dgkf(Asys,nu,ny); elseif(nargin == 4)
--- a/scripts/control/hinf/hinfnorm.m +++ b/scripts/control/hinf/hinfnorm.m @@ -116,7 +116,7 @@ function [g, gmin, gmax] = hinfnorm (sys, tol, gmin, gmax, ptol) if((nargin == 0) || (nargin > 4)) - usage("[g gmin gmax] = hinfnorm(sys[,tol,gmin,gmax,ptol])"); + print_usage (); elseif(!isstruct(sys)) error("Sys must be a system data structure"); endif
--- a/scripts/control/hinf/hinfsyn.m +++ b/scripts/control/hinf/hinfsyn.m @@ -132,7 +132,7 @@ function [K, g, GW, Xinf, Yinf] = hinfsyn (Asys, nu, ny, gmin, gmax, gtol, ptol, tol) if( (nargin < 1) | (nargin > 8) ) - usage("[K,g,GW,Xinf,Yinf] = hinfsyn(Asys,nu,ny,gmin,gmax,gtol,ptol,tol)"); + print_usage (); endif ## set default arguments if(nargin < 8)
--- a/scripts/control/hinf/is_dgkf.m +++ b/scripts/control/hinf/is_dgkf.m @@ -132,7 +132,7 @@ function [retval, dgkf_struct] = is_dgkf (Asys, nu, ny, tol) if (nargin < 3) | (nargin > 4) - usage("[retval,dgkf_struct] = is_dgkf(Asys,nu,ny{,tol})"); + print_usage (); elseif (! isscalar(nu) | ! isscalar(ny) ) error("is_dgkf: arguments 2 and 3 must be scalars") elseif (! isstruct(Asys) )
--- a/scripts/control/hinf/wgt1o.m +++ b/scripts/control/hinf/wgt1o.m @@ -57,11 +57,11 @@ function wsys = wgt1o (vl, vh, fc) if (nargin != 3) - usage("wsys = wgt1o(vl, vh, fc)"); + print_usage (); endif if(nargout > 1) - usage("wsys = wgt1o(vl, vh, fc)"); + print_usage (); endif if (vl == vh)
--- a/scripts/control/obsolete/dezero.m +++ b/scripts/control/obsolete/dezero.m @@ -35,7 +35,7 @@ error("dezero is no longer supported."); if (nargin != 1) - usage ("dezero (s)"); + print_usage (); elseif (ischar (s)) [nr, nc] = size (s);
--- a/scripts/control/system/__sysdefioname__.m +++ b/scripts/control/system/__sysdefioname__.m @@ -40,7 +40,7 @@ function ioname = __sysdefioname__ (n, str, m) if (nargin < 2 | nargin > 3) - usage ("ioname = __sysdefioname__ (n, str, m)"); + print_usage (); endif if (nargin == 2) m = min(1,n); endif
--- a/scripts/control/system/buildssic.m +++ b/scripts/control/system/buildssic.m @@ -161,7 +161,7 @@ function sys = buildssic (Clst, Ulst, Olst, Ilst, s1, s2, s3, s4, s5, s6, s7, s8) if((nargin < 5) || (nargin > 12)) - usage("sys = buildssic(Clst,Ulst,Olst,Ilst,s1,s2,s3,s4,s5,s6,s7,s8)"); + print_usage (); endif if (nargin >= 5) if (!isstruct(s1))
--- a/scripts/control/system/c2d.m +++ b/scripts/control/system/c2d.m @@ -102,7 +102,7 @@ function dsys = c2d (sys, opt, T) ## parse input arguments if(nargin < 1 | nargin > 3) - usage("dsys=c2d(sys[,T])"); + print_usage (); elseif (!isstruct(sys)) error("sys must be a system data structure"); elseif (nargin == 1)
--- a/scripts/control/system/cellidx.m +++ b/scripts/control/system/cellidx.m @@ -37,7 +37,7 @@ function [idxvec,errmsg] = cellidx(listvar,strlist) if(nargin != 2) - usage("idxvec = cellidx(listvar,strlist)"); + print_usage (); endif if(ischar(strlist))
--- a/scripts/control/system/d2c.m +++ b/scripts/control/system/d2c.m @@ -67,7 +67,7 @@ ## SYS_INTERNAL accesses members of system data structure if( (nargin != 1) & (nargin != 2) ) - usage("csys = d2c(sys[,tol]), csys = d2c(sys,opt)"); + print_usage (); elseif (!isstruct(sys)) error("sys must be in system data structure"); elseif(nargin == 1)
--- a/scripts/control/system/dmr2d.m +++ b/scripts/control/system/dmr2d.m @@ -77,7 +77,7 @@ ## parse input arguments if(nargin != 4 | nargout > 2) - usage("[dsys,fidx] = dmr2d (sys, idx, sprefix, Ts2 {,cuflg})"); + print_usage (); elseif (!isstruct(sys)) error("sys must be in system data structure form");
--- a/scripts/control/system/fir2sys.m +++ b/scripts/control/system/fir2sys.m @@ -88,7 +88,7 @@ ## Test for the correct number of input arguments if (nargin < 1 | nargin > 4) - usage ("sys = fir2sys(num [, tsam, inname, outname])"); + print_usage (); endif ## let tf do the argument checking
--- a/scripts/control/system/is_abcd.m +++ b/scripts/control/system/is_abcd.m @@ -91,7 +91,7 @@ return; endif otherwise - usage("retval = is_abcd(a [, b, c, d])") + print_usage (); endswitch ## all tests passed, signal ok. retval = 1;
--- a/scripts/control/system/is_controllable.m +++ b/scripts/control/system/is_controllable.m @@ -66,14 +66,13 @@ deftol = 1; # assume default tolerance if(nargin < 1 | nargin > 3) - usage("[retval,U] = %s\n\t%s", "is_controllable(a {, b, tol})", ... - "is_controllable(sys{,tol})"); + print_usage (); elseif(isstruct(a)) ## system structure passed. sys = sysupdate(a,"ss"); [a,bs] = sys2ss(sys); if(nargin > 2) - usage("[retval,U] = is_controllable(sys{,tol})"); + print_usage (); elseif(nargin == 2) tol = b; % get tolerance deftol = 0; @@ -82,7 +81,7 @@ else ## a,b arguments sent directly. if(nargin < 2) - usage("[retval,U] = is_controllable(a {, b ,tol})"); + print_usage (); else deftol = 1; endif
--- a/scripts/control/system/is_detectable.m +++ b/scripts/control/system/is_detectable.m @@ -39,19 +39,19 @@ function [retval, U] = is_detectable (a, c, tol, dflg) if( nargin < 1) - usage("retval = is_detectable(a , {c , tol, dlfg})"); + print_usage (); elseif(isstruct(a)) ## system form if(nargin == 2) tol = c; elseif(nargin > 2) - usage("retval = is_detectable(sys {, tol})"); + print_usage (); endif dflg = is_digital(a); [a,b,c] = sys2ss(a); else if ((nargin > 4)||(nargin == 1)) - usage("retval = is_detectable(a , {c , tol, dflg})"); + print_usage (); endif if (~exist("dflg")) dflg = 0;
--- a/scripts/control/system/is_digital.m +++ b/scripts/control/system/is_digital.m @@ -54,7 +54,7 @@ error("invalid value of eflg=%d (%e)",eflg,eflg); endif otherwise, - usage("DIGITAL = is_digital(sys{,eflg})"); + print_usage (); endswitch ## checked for sampled data system (mixed)
--- a/scripts/control/system/is_observable.m +++ b/scripts/control/system/is_observable.m @@ -39,17 +39,17 @@ function [retval, U] = is_observable (a, c, tol) if( nargin < 1) - usage("[retval,U] = is_observable(a , c {, tol})"); + print_usage (); elseif(isstruct(a)) ## system form if(nargin == 2) tol = c; elseif(nargin > 2) - usage("[retval,U] = is_observable(sys {, tol})"); + print_usage (); endif [a,b,c] = sys2ss(a); elseif(nargin > 3) - usage("[retval,U] = is_observable(a , c {, tol})"); + print_usage (); endif if(exist("tol")) [retval,U] = is_controllable (a', c', tol);
--- a/scripts/control/system/is_siso.m +++ b/scripts/control/system/is_siso.m @@ -29,7 +29,7 @@ function SISO = is_siso (sys) if (nargin != 1) - usage ("SISO = is_siso (sys)"); + print_usage (); elseif (! isstruct (sys)) error ("input must be a system structure (see ss, tf, zp)"); endif
--- a/scripts/control/system/is_stabilizable.m +++ b/scripts/control/system/is_stabilizable.m @@ -47,20 +47,20 @@ function retval = is_stabilizable (a, b, tol, dflg) if(nargin < 1) - usage("[retval,U] = is_stabilizable(a {, b ,tol, dflg})"); + print_usage (); elseif(isstruct(a)) ## system passed. if(nargin == 2) tol = b; % get tolerance elseif(nargin > 2) - usage("retval = is_stabilizable(sys{,tol})"); + print_usage (); endif disc = is_digital(a); [a,b] = sys2ss(a); else ## a,b arguments sent directly. if ((nargin > 4)||(nargin == 1)) - usage("retval = is_stabilizable(a {, b ,tol, dflg})"); + print_usage (); endif if(exist("dflg")) disc = dflg;
--- a/scripts/control/system/is_stable.m +++ b/scripts/control/system/is_stable.m @@ -48,7 +48,7 @@ function retval = is_stable (a, tol, disc) - if( (nargin < 1) | (nargin > 3) ) usage("is_stable(a {,tol,disc})"); + if( (nargin < 1) | (nargin > 3) ) print_usage (); elseif(isstruct(a)) ## system was passed if(nargin < 3) disc = is_digital(a);
--- a/scripts/control/system/jet707.m +++ b/scripts/control/system/jet707.m @@ -44,10 +44,10 @@ function outsys = jet707 () if (nargin != 0) - usage("outsys = jet707()") + print_usage (); endif if (nargin > 1) - usage("outsys = jet707()") + print_usage (); endif a = [ -0.46E-01, 0.10681415316, 0.0, -0.17121680433;
--- a/scripts/control/system/listidx.m +++ b/scripts/control/system/listidx.m @@ -38,7 +38,7 @@ error("listidx: don't use this anymore, ok?\n"); if(nargin != 2) - usage("idxvec = listidx(listvar,strlist)"); + print_usage (); endif if(ischar(strlist))
--- a/scripts/control/system/ord2.m +++ b/scripts/control/system/ord2.m @@ -67,10 +67,10 @@ ## Updates if(nargin != 2 & nargin != 3) - usage("outsys = ord2(nfreq, damp[, gain])") + print_usage (); endif if (nargout > 1) - usage("outsys = ord2(nfreq, damp[, gain])") + print_usage (); endif if (nargin == 2) gain = 1.0;
--- a/scripts/control/system/parallel.m +++ b/scripts/control/system/parallel.m @@ -44,7 +44,7 @@ function sysp = parallel (Asys, Bsys) if(nargin != 2) - usage("sysp = parallel(Asys,Bsys)"); + print_usage (); endif if(! isstruct(Asys) ) error("1st input argument is not a system data structure")
--- a/scripts/control/system/ss.m +++ b/scripts/control/system/ss.m @@ -191,7 +191,7 @@ ## Test for correct number of inputs if ((nargin < 3) | (nargin > 11)) - usage("retsys = ss (a,b,c{,d,tsam,n,nz,stname,inname,outname,outlist})"); + print_usage (); endif ## verify A, B, C, D arguments
--- a/scripts/control/system/ss2zp.m +++ b/scripts/control/system/ss2zp.m @@ -33,7 +33,7 @@ function [zer, pol, k] = ss2zp (a, b, c, d) if(nargin != 4) - usage("[zer,pol,k] = ss2zp(a,b,c,d)"); + print_usage (); endif [n,m,p] = abcddim(a,b,c,d);
--- a/scripts/control/system/starp.m +++ b/scripts/control/system/starp.m @@ -54,7 +54,7 @@ function sys = starp (P, K, ny, nu); if((nargin != 2) && (nargin != 4)) - usage("sys = starp(P, K, ny, nu)"); + print_usage (); endif if (!isstruct(P)) error("---> P must be in system data structure");
--- a/scripts/control/system/sys2ss.m +++ b/scripts/control/system/sys2ss.m @@ -79,12 +79,12 @@ function [a, b, c, d, tsam, n, nz, stname, inname, outname, yd] = sys2ss (sys) if(nargin != 1) - usage("[a,b,c,d,tsam,n,nz,stname,inname,outname,yd] = sys2ss(sys)") + print_usage (); endif if (nargout > 11) warning(["sys2ss: ",num2str(nargout)," out arguments exceeds max=11"]) - usage("[a,b,c,d,tsam,n,nz,stname,inname,outname,yd] = sys2ss(sys)") + print_usage (); endif if( ! isstruct(sys) )
--- a/scripts/control/system/sys2tf.m +++ b/scripts/control/system/sys2tf.m @@ -40,7 +40,7 @@ function [num, den, tsam, inname, outname] = sys2tf (Asys) if(nargin != 1) - usage("[num,den,tsam,inname,outname] = sys2tf(Asys)"); + print_usage (); endif if( !isstruct(Asys))
--- a/scripts/control/system/sys2zp.m +++ b/scripts/control/system/sys2zp.m @@ -42,7 +42,7 @@ function [zer, pol, k, tsam, inname, outname] = sys2zp (sys) if(nargin != 1) - usage("[zer,pol,k,tsam,inname,outname] = sys2zp(sys)"); + print_usage (); elseif( !isstruct(sys)) error("sysconnect: sys must be in system data structure form") elseif (! is_siso(sys) )
--- a/scripts/control/system/sysadd.m +++ b/scripts/control/system/sysadd.m @@ -47,7 +47,7 @@ function sys = sysadd (varargin) if(nargin < 1) - usage("sysadd: sys = sysysadd(Gsys{,Hsys, ...})"); + print_usage (); endif ## collect all arguments
--- a/scripts/control/system/sysappend.m +++ b/scripts/control/system/sysappend.m @@ -84,7 +84,7 @@ ## check input arguments if ( (nargin < 2) | (nargin > 7) | (!isstruct(sys))) - usage("retsys = sysappend(sys,b,c[,d,outname,inname,yd]) "); + print_usage (); elseif(!isstruct(sys)) error("sys must be a system data structure"); endif
--- a/scripts/control/system/syschtsam.m +++ b/scripts/control/system/syschtsam.m @@ -29,7 +29,7 @@ function retsys = syschtsam (sys, tsam) if (nargin != 2) - usage ("retsys = syschtsam (sys, tsam)"); + print_usage (); elseif (! isstruct (sys)) error ("sys must be in system data structure form"); elseif (! isscalar (tsam))
--- a/scripts/control/system/sysconnect.m +++ b/scripts/control/system/sysconnect.m @@ -76,7 +76,7 @@ function sys = sysconnect (sys, output_list, input_list, order, tol) if( (nargin < 3) | (nargin > 5) ) - usage("retsys = sysconnect(sys,output_list,input_list[,order,tol])"); + print_usage (); endif ## check order
--- a/scripts/control/system/syscont.m +++ b/scripts/control/system/syscont.m @@ -46,7 +46,7 @@ function [csys, Acd, Ccd] = syscont (sys) if (nargin != 1) - usage("[csys,Acd,Ccd,Dcd] = syscont(sys)"); + print_usage (); elseif (!isstruct(sys)) error("sys must be in system data structure form"); endif
--- a/scripts/control/system/sysdimensions.m +++ b/scripts/control/system/sysdimensions.m @@ -69,9 +69,9 @@ function [n, nz, m, p, yd] = sysdimensions (sys, opt) if(nargout > 5 | nargin < 1 | nargin > 2) - usage("[n,nz,m,p[,yd]] = sysdimensions(sys{,opt})"); + print_usage (); elseif(!isstruct(sys)) - usage("[n,nz,m,p] = sysdimensions(sys)"); + print_usage (); elseif(nargin == 1) opt = "all"; endif
--- a/scripts/control/system/sysdisc.m +++ b/scripts/control/system/sysdisc.m @@ -41,7 +41,7 @@ function [dsys, Adc, Cdc] = sysdisc (sys) if (nargin != 1) - usage("[dsys,Adc,Cdc] = sysdisc(sys)"); + print_usage (); elseif (!isstruct(sys)) error("sys must be in system data structure form"); endif
--- a/scripts/control/system/sysdup.m +++ b/scripts/control/system/sysdup.m @@ -62,7 +62,7 @@ function retsys = sysdup (Asys, output_list, input_list) if( nargin != 3) - usage("retsys = sysdup(Asys,output_list,input_list)"); + print_usage (); endif if( !isstruct(Asys))
--- a/scripts/control/system/sysgetsignals.m +++ b/scripts/control/system/sysgetsignals.m @@ -147,9 +147,9 @@ ## Adapted from ss if(nargin < 1 | nargin > 4 | nargout > 4) - usage("[stname{,inname,outname,yd}] = sysgetsignals(sys{,sigid,signum})") + print_usage (); elseif(nargin > 1 & nargout > 1) - usage("sig = sysgetsignals(sys,sigid{,signum,strflg})") + print_usage (); elseif( ! isstruct(sys) ) error("input argument must be a system data structure"); endif
--- a/scripts/control/system/sysgettsam.m +++ b/scripts/control/system/sysgettsam.m @@ -25,7 +25,7 @@ function T = sysgettsam (sys) if (! isstruct (sys)) - usage ("T = sysgettsam (sys)"); + print_usage (); endif T = sys.tsam;
--- a/scripts/control/system/sysgroup.m +++ b/scripts/control/system/sysgroup.m @@ -60,7 +60,7 @@ function sys = sysgroup (varargin) if(nargin < 1) - usage("sys = sysgroup(Asys{,Bsys,...})"); + print_usage (); endif ## collect all arguments
--- a/scripts/control/system/sysidx.m +++ b/scripts/control/system/sysidx.m @@ -28,7 +28,7 @@ function idxvec = sysidx (sys, sigtype, signamelist) if (nargin != 3) - usage ("idxvec = sysidx (sys, sigtype, signamelist)"); + print_usage (); elseif (! isstruct (sys)) error ("sys must be a system data structure"); elseif (! ischar (sigtype))
--- a/scripts/control/system/sysmin.m +++ b/scripts/control/system/sysmin.m @@ -55,7 +55,7 @@ case(1), flg = 0; case(2), jnk = flg; # dummy operation otherwise, - usage("[retsys,nc,no] = sysmin(sys{,flg})"); + print_usage (); endswitch dflg = is_digital(sys,2); [n,nz,m,p] = sysdimensions(sys);
--- a/scripts/control/system/sysmult.m +++ b/scripts/control/system/sysmult.m @@ -40,7 +40,7 @@ function sys = sysmult (varargin) if(nargin < 1) - usage("sysmult: sys = sysmult(Asys{,Bsys,...})"); + print_usage (); endif ## collect all arguments
--- a/scripts/control/system/sysout.m +++ b/scripts/control/system/sysout.m @@ -46,7 +46,7 @@ function retsys = sysout (sys, opt) if( (nargin < 1) || (nargin > 2) ) - usage("sysout(sys[,opt])"); + print_usage (); endif if(isempty(sys))
--- a/scripts/control/system/sysprune.m +++ b/scripts/control/system/sysprune.m @@ -61,7 +61,7 @@ function sys = sysprune (sys, output_idx, input_idx, state_idx) if( nargin < 3 | nargin > 4 ) - usage("retsys = sysprune(sys,output_idx,input_idx{,state_idx})"); + print_usage (); elseif(nargin < 4) state_idx = []; endif
--- a/scripts/control/system/sysscale.m +++ b/scripts/control/system/sysscale.m @@ -60,7 +60,7 @@ function sys = sysscale (sys, outscale, inscale, outname, inname) if( (nargin < 3) || (nargin > 5) ) - usage("retsys = sysscale(Asys,output_list,input_list{,inname,outname})"); + print_usage (); elseif (!isstruct(sys)) error("sys must be a structured system"); endif
--- a/scripts/control/system/syssetsignals.m +++ b/scripts/control/system/syssetsignals.m @@ -96,7 +96,7 @@ function retsys = syssetsignals (sys, opt, names, sig_idx) if (nargin < 3 | nargin > 4) - usage("retsys=syssetsignals(sys,opt,names{,sig_idx})"); + print_usage (); elseif (!isstruct(sys)) error("sys must be a system data structure"); elseif (isempty(opt))
--- a/scripts/control/system/syssub.m +++ b/scripts/control/system/syssub.m @@ -48,7 +48,7 @@ function sys = syssub (varargin) if(nargin < 1) - usage("syssub: sys = syssub(Gsys{,Hsys,...})"); + print_usage (); endif ## collect all arguments
--- a/scripts/control/system/sysupdate.m +++ b/scripts/control/system/sysupdate.m @@ -58,7 +58,7 @@ ## check for correct number of inputs if (nargin != 2) - usage("newsys = sysupdate(sys,opt)"); + print_usage (); elseif(! isstruct(sys) ) error("1st argument must be system data structure") elseif(! (strcmp(opt,"tf") + strcmp(opt,"zp") + ...
--- a/scripts/control/system/tf.m +++ b/scripts/control/system/tf.m @@ -62,7 +62,7 @@ ## Test for the correct number of input arguments if ((nargin < 2) || (nargin > 5)) - usage ("outsys = tf (num, den [, tsam, inname, outname])"); + print_usage (); return endif
--- a/scripts/control/system/tfout.m +++ b/scripts/control/system/tfout.m @@ -31,7 +31,7 @@ function tfout (num, denom, x) if (nargin < 2 ) | (nargin > 3) | (nargout != 0 ) - usage("tfout(num,denom[,x])"); + print_usage (); endif if ( (!isvector(num)) | (!isvector(denom)) )
--- a/scripts/control/system/ugain.m +++ b/scripts/control/system/ugain.m @@ -33,7 +33,7 @@ function outsys = ugain (n) if (nargin != 1 || nargout > 1) - usage ("outsys = ugain(n)"); + print_usage (); endif outsys = ss ([], [], [], eye (n));
--- a/scripts/control/system/zp.m +++ b/scripts/control/system/zp.m @@ -60,7 +60,7 @@ ## Test for the correct number of input arguments if ((nargin < 3) || (nargin > 6)) - usage("outsys = zp(zer,pol,k[,tsam,inname,outname])"); + print_usage (); endif ## check input format
--- a/scripts/control/system/zpout.m +++ b/scripts/control/system/zpout.m @@ -31,7 +31,7 @@ function zpout (zer, pol, k, x) if (nargin < 3 ) | (nargin > 4) | (nargout != 0 ) - usage("zpout(zer,pol,k[,x])"); + print_usage (); endif if( !(isvector(zer) | isempty(zer)) | !(isvector(pol) | isempty(pol)) )
--- a/scripts/control/util/__outlist__.m +++ b/scripts/control/util/__outlist__.m @@ -48,7 +48,7 @@ function str_val = __outlist__ (name_list, tabchar, yd, ilist) if( nargin < 1 | nargin > 4 ) - usage("str_val = outlist(x[,tabchar,yd,ilist])"); + print_usage (); endif m = length(name_list);
--- a/scripts/control/util/__zgpbal__.m +++ b/scripts/control/util/__zgpbal__.m @@ -46,7 +46,7 @@ function retsys = __zgpbal__ (Asys) if( (nargin != 1) | (!isstruct(Asys))) - usage("retsys = __zgpbal__ (Asys)"); + print_usage (); endif Asys = sysupdate(Asys,"ss");
--- a/scripts/control/util/prompt.m +++ b/scripts/control/util/prompt.m @@ -38,7 +38,7 @@ function prompt (str) if (nargin > 1) - usage ("prompt ([str])"); + print_usage (); elseif (nargin == 0) str = "\n ---- Press a key to continue ---"; elseif (! ischar (str) )
--- a/scripts/control/util/sortcom.m +++ b/scripts/control/util/sortcom.m @@ -54,7 +54,7 @@ function [yy, idx] = sortcom (xx, opt) if( nargin < 1 | nargin > 2 ) - usage("yy = sortcom(xx[,opt]"); + print_usage (); elseif( !(isvector(xx) | isempty(xx) )) error("sortcom: first argument must be a vector"); endif
--- a/scripts/control/util/strappend.m +++ b/scripts/control/util/strappend.m @@ -25,7 +25,7 @@ function retval = strappend (strlist, suffix); if (nargin != 2 || nargout > 1) - usage ("retval = strappend (strlist, suffix)"); + print_usage (); elseif (! is_signal_list (strlist)) error ("strlist must be a list of strings (see is_signal_list)"); elseif (! (ischar (suffix) && rows (suffix) == 1))
--- a/scripts/deprecated/com2str.m +++ b/scripts/deprecated/com2str.m @@ -36,7 +36,7 @@ function retval = com2str (zz, flg) if (nargin < 1 || nargin > 2) - usage ("com2str (zz, flg)"); + print_usage (); endif if (nargin == 1) flg = 0;
--- a/scripts/elfun/acot.m +++ b/scripts/elfun/acot.m @@ -27,7 +27,7 @@ function w = acot (z) if (nargin != 1) - usage ("acot (z)"); + print_usage (); endif w = atan (1./z);
--- a/scripts/elfun/acoth.m +++ b/scripts/elfun/acoth.m @@ -27,7 +27,7 @@ function w = acoth (z) if (nargin != 1) - usage ("acoth (z)"); + print_usage (); endif w = atanh (1 ./ z);
--- a/scripts/elfun/acsc.m +++ b/scripts/elfun/acsc.m @@ -27,7 +27,7 @@ function w = acsc (z) if (nargin != 1) - usage ("acsc (z)"); + print_usage (); endif w = asin (1 ./ z);
--- a/scripts/elfun/acsch.m +++ b/scripts/elfun/acsch.m @@ -27,7 +27,7 @@ function w = acsch (z) if (nargin != 1) - usage ("acsch (z)"); + print_usage (); endif w = asinh (1 ./ z);
--- a/scripts/elfun/asec.m +++ b/scripts/elfun/asec.m @@ -27,7 +27,7 @@ function w = asec (z) if (nargin != 1) - usage ("asec (z)"); + print_usage (); endif w = acos (1 ./ z);
--- a/scripts/elfun/asech.m +++ b/scripts/elfun/asech.m @@ -27,7 +27,7 @@ function w = asech (z) if (nargin != 1) - usage ("acosh (z)"); + print_usage (); endif w = acosh (1 ./ z);
--- a/scripts/elfun/cot.m +++ b/scripts/elfun/cot.m @@ -27,7 +27,7 @@ function w = cot (z) if (nargin != 1) - usage ("cot (z)"); + print_usage (); endif w = 1 ./ tan(z);
--- a/scripts/elfun/coth.m +++ b/scripts/elfun/coth.m @@ -27,7 +27,7 @@ function w = coth (z) if (nargin != 1) - usage ("coth (z)"); + print_usage (); endif w = 1 ./ tanh (z);
--- a/scripts/elfun/csc.m +++ b/scripts/elfun/csc.m @@ -27,7 +27,7 @@ function w = csc (z) if (nargin != 1) - usage ("csc (z)"); + print_usage (); endif w = 1 ./ sin(z);
--- a/scripts/elfun/csch.m +++ b/scripts/elfun/csch.m @@ -27,7 +27,7 @@ function w = csch (z) if (nargin != 1) - usage ("csch (z)"); + print_usage (); endif w = 1 ./ sinh(z);
--- a/scripts/elfun/lcm.m +++ b/scripts/elfun/lcm.m @@ -44,7 +44,7 @@ function l = lcm (varargin) if (nargin == 0) - usage ("lcm (a, ...)"); + print_usage (); endif if (nargin == 1)
--- a/scripts/elfun/sec.m +++ b/scripts/elfun/sec.m @@ -27,7 +27,7 @@ function w = sec (z) if (nargin != 1) - usage ("sec (z)"); + print_usage (); endif w = 1 ./ cos(z);
--- a/scripts/elfun/sech.m +++ b/scripts/elfun/sech.m @@ -27,7 +27,7 @@ function w = sech (z) if (nargin != 1) - usage ("sech (z)"); + print_usage (); endif w = 1 ./ cosh(z);
--- a/scripts/finance/fv.m +++ b/scripts/finance/fv.m @@ -40,7 +40,7 @@ function v = fv (r, n, p, l, m) if ((nargin < 3) || (nargin > 5)) - usage ("fv (r, n, p, l, method)"); + print_usage (); endif if (! (isscalar (r) && (r > -1)))
--- a/scripts/finance/fvl.m +++ b/scripts/finance/fvl.m @@ -33,7 +33,7 @@ function v = fvl (r, n, l) if (nargin != 3) - usage ("fvl (r, n, l)"); + print_usage (); endif if (! (isscalar (r) && (r > -1)))
--- a/scripts/finance/irr.m +++ b/scripts/finance/irr.m @@ -34,7 +34,7 @@ if (nargin == 1) i = 0; elseif (! (nargin == 2)) - usage ("irr (p, i)"); + print_usage (); endif if (! (isvector (p)))
--- a/scripts/finance/nper.m +++ b/scripts/finance/nper.m @@ -40,7 +40,7 @@ function n = nper (r, p, a, l, m) if ((nargin < 3) || (nargin > 5)) - usage ("nper (r, p, a, l, method)"); + print_usage (); endif if (! (isscalar (r) && (r > -1)))
--- a/scripts/finance/npv.m +++ b/scripts/finance/npv.m @@ -39,7 +39,7 @@ function v = npv (r, p, i) if ((nargin < 2) || (nargin > 3)) - usage ("npv (r, p, i"); + print_usage (); endif if (! (isvector (p)))
--- a/scripts/finance/pmt.m +++ b/scripts/finance/pmt.m @@ -37,7 +37,7 @@ function p = pmt (r, n, a, l, m) if (nargin < 3 || nargin > 5) - usage ("pmt (r, n, a, l, method)"); + print_usage (); endif if (! (isscalar (r) && r > -1))
--- a/scripts/finance/pv.m +++ b/scripts/finance/pv.m @@ -40,7 +40,7 @@ function v = pv (r, n, p, l, m) if ((nargin < 3) || (nargin > 5)) - usage ("pv (r, n, p, l, method)"); + print_usage (); endif if (! (isscalar (r) && (r > -1)))
--- a/scripts/finance/pvl.m +++ b/scripts/finance/pvl.m @@ -33,7 +33,7 @@ function v = pvl (r, n, p) if (nargin != 3) - usage ("pvl (r, n, p)"); + print_usage (); endif if (! (isscalar (r) && (r > -1)))
--- a/scripts/finance/rate.m +++ b/scripts/finance/rate.m @@ -37,7 +37,7 @@ function r = rate (n, p, v, l, m) if ((nargin < 3) || (nargin > 5)) - usage ("rate (n, p, v, l, method)"); + print_usage (); endif if (! (isscalar (n) && (n > 0)))
--- a/scripts/finance/vol.m +++ b/scripts/finance/vol.m @@ -34,7 +34,7 @@ function retval = vol (X, m, n) if (nargin < 2) - usage ("vol (X, m, n)"); + print_usage (); endif [xr, xc] = size (X);
--- a/scripts/general/__isequal__.m +++ b/scripts/general/__isequal__.m @@ -45,7 +45,7 @@ function t = __isequal__ (nans_compare_equal, x, varargin) if (nargin < 3) - usage ("__isequal__ (nans_compare_equal, x1, x2, ...)"); + print_usage (); endif l_v = nargin - 2;
--- a/scripts/general/bitcmp.m +++ b/scripts/general/bitcmp.m @@ -36,7 +36,7 @@ function X = bitcmp (A, n) if (nargin < 1 || nargin > 2) - usage ("bitcmp (A, n)"); + print_usage (); endif if (isa (A, "double"))
--- a/scripts/general/bitget.m +++ b/scripts/general/bitget.m @@ -32,7 +32,7 @@ function X = bitget (A, n) if (nargin != 2) - usage ("bitget (A, n)"); + print_usage (); endif if (isa (A, "double"))
--- a/scripts/general/bitset.m +++ b/scripts/general/bitset.m @@ -34,7 +34,7 @@ function X = bitset (A, n, value) if (nargin < 2 || nargin > 3) - usage ("bitset (A, n, v)"); + print_usage (); endif if (nargin == 2)
--- a/scripts/general/blkdiag.m +++ b/scripts/general/blkdiag.m @@ -29,7 +29,7 @@ function retval = blkdiag (varargin) if (nargin < 1) - usage ("blkdiag (a, b, c, ...)"); + print_usage (); endif if (! all (cellfun (@isnumeric, varargin)))
--- a/scripts/general/cart2sph.m +++ b/scripts/general/cart2sph.m @@ -33,7 +33,7 @@ function [Theta, Phi, R] = cart2sph (X, Y, Z) if (nargin != 3) - usage ("[Theta, Phi, R] = cart2sph (X, Y, Z)") + print_usage (); endif if ((! (ismatrix (X) && ismatrix (Y) && ismatrix (Z)))
--- a/scripts/general/cell2mat.m +++ b/scripts/general/cell2mat.m @@ -27,7 +27,7 @@ function m = cell2mat (c) if (nargin != 1) - usage ("m = cell2mat (c)"); + print_usage (); endif if (! iscell (c))
--- a/scripts/general/circshift.m +++ b/scripts/general/circshift.m @@ -80,6 +80,6 @@ endfor y = x(idx{:}); else - usage ("circshift (x, n)"); + print_usage (); endif endfunction
--- a/scripts/general/cplxpair.m +++ b/scripts/general/cplxpair.m @@ -51,7 +51,7 @@ function y = cplxpair (z, tol, dim) if nargin < 1 || nargin > 3 - usage ("z = cplxpair (z, tol, dim);"); + print_usage (); endif if (length (z) == 0)
--- a/scripts/general/cumtrapz.m +++ b/scripts/general/cumtrapz.m @@ -40,7 +40,7 @@ function z = cumtrapz (x, y, dim) if (nargin < 1) || (nargin > 3) - usage ("cumtrapz (x, y, dim)"); + print_usage (); endif nd = ndims (x);
--- a/scripts/general/deal.m +++ b/scripts/general/deal.m @@ -65,7 +65,7 @@ function [varargout] = deal (varargin) if (nargin == 0) - usage ("[a, b, c, d] = deal (x, y, z, a)"); + print_usage (); elseif (nargin == 1 || nargin == nargout) varargout(1:nargout) = varargin; else
--- a/scripts/general/diff.m +++ b/scripts/general/diff.m @@ -54,7 +54,7 @@ function x = diff (x, k, dim) if (nargin < 1 || nargin > 3) - usage ("diff (x, k"); + print_usage (); endif if (nargin < 2 || isempty(k))
--- a/scripts/general/flipdim.m +++ b/scripts/general/flipdim.m @@ -37,7 +37,7 @@ function y = flipdim (x, dim) if (nargin != 1 && nargin != 2) - usage ("flipdim (x, dim)"); + print_usage (); endif nd = ndims (x);
--- a/scripts/general/fliplr.m +++ b/scripts/general/fliplr.m @@ -40,7 +40,7 @@ function y = fliplr (x) if (nargin != 1) - usage ("fliplr (x)"); + print_usage (); endif if (ndims (x) > 2)
--- a/scripts/general/flipud.m +++ b/scripts/general/flipud.m @@ -41,7 +41,7 @@ function y = flipud (x) if (nargin != 1) - usage ("flipud (x)"); + print_usage (); endif if (ndims (x) > 2)
--- a/scripts/general/ind2sub.m +++ b/scripts/general/ind2sub.m @@ -68,7 +68,7 @@ error ("ind2sub: expecting dims to be an integer vector"); endif else - usage ("ind2sub (dims, ind)"); + print_usage (); endif
--- a/scripts/general/int2str.m +++ b/scripts/general/int2str.m @@ -53,7 +53,7 @@ tmp(end) = ""; retval = split (tmp, "\n"); else - usage ("int2str (x)"); + print_usage (); endif endfunction
--- a/scripts/general/is_duplicate_entry.m +++ b/scripts/general/is_duplicate_entry.m @@ -38,7 +38,7 @@ error ("is_duplicate_entry: expecting matrix argument"); endif else - usage ("is_duplicate_entry (x)"); + print_usage (); endif endfunction
--- a/scripts/general/isdefinite.m +++ b/scripts/general/isdefinite.m @@ -51,7 +51,7 @@ error ("isdefinite: matrix x must be symmetric"); endif else - usage ("isdefinite (x,tol)"); + print_usage (); endif endfunction
--- a/scripts/general/isequal.m +++ b/scripts/general/isequal.m @@ -28,7 +28,7 @@ if (nargin > 1) retval = __isequal__ (0, x, varargin{:}); else - usage ("isequal (x1, x2, ...)"); + print_usage (); endif endfunction
--- a/scripts/general/isequalwithequalnans.m +++ b/scripts/general/isequalwithequalnans.m @@ -29,7 +29,7 @@ if (nargin > 1) retval = __isequal__ (1, x, varargin{:}); else - usage ("isequalwithequalnans (x1, x2, ...)"); + print_usage (); endif endfunction
--- a/scripts/general/isscalar.m +++ b/scripts/general/isscalar.m @@ -30,7 +30,7 @@ if (nargin == 1) retval = prod (size (x)) == 1; else - usage ("isscalar (x)"); + print_usage (); endif endfunction
--- a/scripts/general/issquare.m +++ b/scripts/general/issquare.m @@ -40,7 +40,7 @@ endif endif else - usage ("issquare (x)"); + print_usage (); endif endfunction
--- a/scripts/general/issymmetric.m +++ b/scripts/general/issymmetric.m @@ -44,7 +44,7 @@ endif endif else - usage ("issymmetric (x {,tol})"); + print_usage (); endif endfunction
--- a/scripts/general/isvector.m +++ b/scripts/general/isvector.m @@ -33,7 +33,7 @@ sz = size (x); retval = (ndims (x) == 2 && (sz(1) == 1 || sz(2) == 1)); else - usage ("isvector (x)"); + print_usage (); endif endfunction
--- a/scripts/general/logical.m +++ b/scripts/general/logical.m @@ -46,7 +46,7 @@ error ("logical not defined for type `%s'", typeinfo (x)); endif else - usage ("logical (x)"); + print_usage (); endif endfunction
--- a/scripts/general/logspace.m +++ b/scripts/general/logspace.m @@ -74,7 +74,7 @@ error ("logspace: arguments must be scalars"); endif else - usage ("logspace (x1, x2, n)"); + print_usage (); endif if (npoints < 2)
--- a/scripts/general/mod.m +++ b/scripts/general/mod.m @@ -41,7 +41,7 @@ function r = mod (x, y) if (nargin != 2) - usage ("r = mod (x, y)"); + print_usage (); endif if (((ndims (x) != ndims (y)) || any (size (x) != size (y))) &&
--- a/scripts/general/nargchk.m +++ b/scripts/general/nargchk.m @@ -32,7 +32,7 @@ function retval = nargchk (nargin_min, nargin_max, n) if (nargin != 3) - usage ("nargchk (nargin_min, nargin_max, n)"); + print_usage (); endif if (nargin_min > nargin_max)
--- a/scripts/general/nextpow2.m +++ b/scripts/general/nextpow2.m @@ -40,7 +40,7 @@ function n = nextpow2 (x) if (nargin != 1) - usage ("nextpow2 (x)"); + print_usage (); endif if (! (isscalar (x) || isvector (x)))
--- a/scripts/general/perror.m +++ b/scripts/general/perror.m @@ -31,7 +31,7 @@ function perror (name, err) if (nargin != 2) - usage ("perror (name, err)"); + print_usage (); else printf (strerror (name, err)); endif
--- a/scripts/general/postpad.m +++ b/scripts/general/postpad.m @@ -28,7 +28,7 @@ function y = postpad (x, l, c, dim) if (nargin < 2 || nargin > 4) - usage ("postpad (x, l, [c, [dim]])"); + print_usage (); endif if (nargin < 3 || isempty (c))
--- a/scripts/general/prepad.m +++ b/scripts/general/prepad.m @@ -41,7 +41,7 @@ function y = prepad (x, l, c, dim) if (nargin < 2 || nargin > 4) - usage ("prepad (x, l, [c, [dim]])"); + print_usage (); endif if (nargin < 3 || isempty (c))
--- a/scripts/general/randperm.m +++ b/scripts/general/randperm.m @@ -35,7 +35,7 @@ error ("randperm: argument must be non-negative"); endif else - usage ("randperm (n)"); + print_usage (); endif endfunction
--- a/scripts/general/rem.m +++ b/scripts/general/rem.m @@ -36,7 +36,7 @@ function r = rem (x, y) if (nargin != 2) - usage ("rem (x, y)"); + print_usage (); endif if (((ndims (x) != ndims (y)) || any (size (x) != size (y))) &&
--- a/scripts/general/repmat.m +++ b/scripts/general/repmat.m @@ -31,7 +31,7 @@ function x = repmat (a, m, n) if (nargin < 2 || nargin > 3) - usage ("repmat (a, m, n)"); + print_usage (); endif if (nargin == 3)
--- a/scripts/general/rot90.m +++ b/scripts/general/rot90.m @@ -86,7 +86,7 @@ error ("rot90: internal error!"); endif else - usage ("rot90 (x, k)"); + print_usage (); endif endfunction
--- a/scripts/general/rotdim.m +++ b/scripts/general/rotdim.m @@ -55,7 +55,7 @@ function y = rotdim (x, k, plane) if (nargin < 1 || nargin > 3) - usage ("rotdim (x, k, plane)"); + print_usage (); endif if (nargin > 1 && ! isempty(k))
--- a/scripts/general/shift.m +++ b/scripts/general/shift.m @@ -35,7 +35,7 @@ function y = shift (x, b, dim) if (nargin != 2 && nargin != 3) - usage ("shift (X, b, dim)"); + print_usage (); endif if (! (isscalar (b) && b == round (b)))
--- a/scripts/general/shiftdim.m +++ b/scripts/general/shiftdim.m @@ -51,7 +51,7 @@ function [y, ns] = shiftdim (x, n) if (nargin < 1 || nargin > 2) - usage ("shiftdim (x, n) or [b, ns] = shiftdim (x)"); + print_usage (); endif nd = ndims (x);
--- a/scripts/general/sph2cart.m +++ b/scripts/general/sph2cart.m @@ -33,7 +33,7 @@ function [X, Y, Z] = sph2cart (Theta, Phi, R) if (nargin != 3) - usage ("[X, Y, Z] = sph2cart (Theta, Phi, R)"); + print_usage (); endif if ((! (ismatrix (Theta) && ismatrix (Phi) && ismatrix (R)))
--- a/scripts/general/strerror.m +++ b/scripts/general/strerror.m @@ -30,7 +30,7 @@ function msg = strerror (name, err) if (nargin != 2) - usage ("strerror (name, err)"); + print_usage (); endif if (! ischar (name))
--- a/scripts/general/sub2ind.m +++ b/scripts/general/sub2ind.m @@ -64,7 +64,7 @@ error ("sub2ind: expecting dims to be an integer vector"); endif else - usage ("sub2ind (dims, i1, i2, ..., iN)"); + print_usage (); endif
--- a/scripts/general/trapz.m +++ b/scripts/general/trapz.m @@ -40,7 +40,7 @@ if (nargin < 1) || (nargin > 3) - usage ("trapz (x, y, dim)"); + print_usage (); endif nd = ndims (x);
--- a/scripts/general/tril.m +++ b/scripts/general/tril.m @@ -78,7 +78,7 @@ error ("tril: requested diagonal out of range"); endif else - usage ("tril (x, k)"); + print_usage (); endif for j = 1 : min (nc, nr+k)
--- a/scripts/general/triu.m +++ b/scripts/general/triu.m @@ -38,7 +38,7 @@ error ("triu: requested diagonal out of range"); endif else - usage ("triu (x, k)"); + print_usage (); endif for j = max (1, k+1) : nc
--- a/scripts/image/gray.m +++ b/scripts/image/gray.m @@ -33,7 +33,7 @@ if (nargin == 0) number = 64; elseif (nargin > 1) - usage ("gray (number)"); + print_usage (); endif gr = [0:(number-1)]';
--- a/scripts/image/gray2ind.m +++ b/scripts/image/gray2ind.m @@ -29,7 +29,7 @@ function [X, map] = gray2ind (I, n) if (nargin < 1 || nargin > 2) - usage ("gray2ind (I, n)"); + print_usage (); elseif (nargin == 1) n = 64; endif
--- a/scripts/image/hsv2rgb.m +++ b/scripts/image/hsv2rgb.m @@ -34,7 +34,7 @@ ## each color with f_r(hue-2/3) = f_g(hue) = f_b(hue-1/3) if (nargin != 1) - usage ("rgb_map = hsv2rgb (hsv_map)"); + print_usage (); endif if (! ismatrix (hsv_map) || columns (hsv_map) != 3)
--- a/scripts/image/image.m +++ b/scripts/image/image.m @@ -54,7 +54,7 @@ elseif (nargin == 3) zoom = []; elseif (nargin > 4) - usage ("image (matrix, zoom) or image (x, y, matrix, zoom)"); + print_usage (); endif if isempty(zoom)
--- a/scripts/image/imagesc.m +++ b/scripts/image/imagesc.m @@ -44,7 +44,7 @@ function ret = imagesc (x, y, A, zoom, limits) if (nargin < 1 || nargin > 5) - usage ("B = imagesc ([x, y,] matrix [,limits] [,zoom])"); + print_usage (); elseif (nargin == 1) A = x; zoom = x = y = limits = [];
--- a/scripts/image/ind2gray.m +++ b/scripts/image/ind2gray.m @@ -32,7 +32,7 @@ function Y = ind2gray (X, map) if (nargin < 1 || nargin > 2) - usage ("ind2gray (X, map)"); + print_usage (); elseif (nargin == 1) map = colormap (); endif
--- a/scripts/image/ind2rgb.m +++ b/scripts/image/ind2rgb.m @@ -31,7 +31,7 @@ function [R, G, B] = ind2rgb (X, map) if (nargin < 1 || nargin > 2) - usage ("ind2rgb (X, map)"); + print_usage (); elseif (nargin == 1) map = colormap (); endif
--- a/scripts/image/loadimage.m +++ b/scripts/image/loadimage.m @@ -31,7 +31,7 @@ function [img_retval, map_retval] = loadimage (filename) if (nargin != 1) - usage ("[img, map] = loadimage (filename)"); + print_usage (); elseif (! ischar (filename)) error ("loadimage: expecting filename as a string"); endif
--- a/scripts/image/ntsc2rgb.m +++ b/scripts/image/ntsc2rgb.m @@ -29,7 +29,7 @@ function rgb = ntsc2rgb (yiq) if (nargin != 1) - usage ("ntsc2rgb (yiq)"); + print_usage (); endif trans = [ 1.0, 1.0, 1.0;
--- a/scripts/image/ocean.m +++ b/scripts/image/ocean.m @@ -36,7 +36,7 @@ error ("ocean: argument must be a scalar"); endif else - usage ("ocean (number)"); + print_usage (); endif cutin = fix (number/3);
--- a/scripts/image/rgb2hsv.m +++ b/scripts/image/rgb2hsv.m @@ -36,7 +36,7 @@ function hsval = rgb2hsv (rgb) if (nargin != 1) - usage ("hsv_map = rgb2hsv (rgb_map)"); + print_usage (); endif if (! ismatrix (rgb) || columns (rgb) != 3)
--- a/scripts/image/rgb2ntsc.m +++ b/scripts/image/rgb2ntsc.m @@ -29,7 +29,7 @@ function yiq = rgb2ntsc (rgb) if (nargin != 1) - usage ("rgb2ntsc (rgb)"); + print_usage (); endif trans = [ 0.299, 0.596, 0.211;
--- a/scripts/image/saveimage.m +++ b/scripts/image/saveimage.m @@ -77,7 +77,7 @@ function saveimage (filename, img, img_form, map) if (nargin < 2 || nargin > 4) - usage ("saveimage (filename, matrix, [format, [colormap]])"); + print_usage (); endif if (nargin < 4)
--- a/scripts/io/beep.m +++ b/scripts/io/beep.m @@ -30,7 +30,7 @@ if (nargin == 0) puts ("\a"); else - usage ("beep ()"); + print_usage (); endif endfunction
--- a/scripts/linear-algebra/commutation_matrix.m +++ b/scripts/linear-algebra/commutation_matrix.m @@ -87,7 +87,7 @@ function k = commutation_matrix (m, n) if (nargin < 1 || nargin > 2) - usage ("commutation_matrix (m, n)"); + print_usage (); else if (! (isscalar (m) && m == round (m) && m > 0)) error ("commutation_matrix: m must be a positive integer");
--- a/scripts/linear-algebra/cond.m +++ b/scripts/linear-algebra/cond.m @@ -51,7 +51,7 @@ endif endif else - usage ("cond (a)"); + print_usage (); endif endfunction
--- a/scripts/linear-algebra/cross.m +++ b/scripts/linear-algebra/cross.m @@ -42,7 +42,7 @@ function z = cross (x, y, dim) if (nargin != 2 && nargin != 3) - usage ("cross (x, y, dim)"); + print_usage (); endif if (ndims (x) < 3 && ndims (y) < 3 && nargin < 3)
--- a/scripts/linear-algebra/dmult.m +++ b/scripts/linear-algebra/dmult.m @@ -29,7 +29,7 @@ function M = dmult (a, B) if (nargin != 2) - usage ("dmult (a, B)"); + print_usage (); endif if (! isvector (a)) error ("dmult: a must be a vector of length rows (B)");
--- a/scripts/linear-algebra/dot.m +++ b/scripts/linear-algebra/dot.m @@ -30,7 +30,7 @@ function z = dot (x, y, dim) if (nargin != 2 && nargin != 3) - usage ("dot (x, y, dim)"); + print_usage (); endif if (nargin < 3)
--- a/scripts/linear-algebra/duplication_matrix.m +++ b/scripts/linear-algebra/duplication_matrix.m @@ -76,7 +76,7 @@ function d = duplication_matrix (n) if (nargin != 1) - usage ("duplication_matrix (n)"); + print_usage (); endif if (! (isscalar (n) && n == round (n) && n > 0))
--- a/scripts/linear-algebra/krylov.m +++ b/scripts/linear-algebra/krylov.m @@ -55,7 +55,7 @@ defeps = 1e-12; if (nargin < 3 || nargin > 5) - usage ("[U, nu] = krylov (A, V, k, eps1, pflg)") + print_usage (); elseif (nargin < 5) pflg = 0; # default permutation flag endif
--- a/scripts/linear-algebra/krylovb.m +++ b/scripts/linear-algebra/krylovb.m @@ -32,7 +32,7 @@ case (5) [Uret, H, Ucols] = krylov (A, V, k, eps1, pflg); otherwise - usage ("[Uret, Ucols] = krylovb (A, V, k ,eps1, pflg)"); + print_usage (); endswitch endfunction
--- a/scripts/linear-algebra/logm.m +++ b/scripts/linear-algebra/logm.m @@ -27,7 +27,7 @@ function B = logm (A) if (nargin != 1) - usage ("B = logm (A)"); + print_usage (); endif [V, D] = eig (A);
--- a/scripts/linear-algebra/norm.m +++ b/scripts/linear-algebra/norm.m @@ -60,7 +60,7 @@ function retval = norm (x, p) if (nargin < 1 || nargin > 2) - usage ("norm (x, p)"); + print_usage (); endif if (isempty (x))
--- a/scripts/linear-algebra/null.m +++ b/scripts/linear-algebra/null.m @@ -54,7 +54,7 @@ if (nargin == 1) tol = max (size (A)) * s (1) * eps; elseif (nargin != 2) - usage ("null (A, tol)"); + print_usage (); endif rank = sum (s > tol);
--- a/scripts/linear-algebra/orth.m +++ b/scripts/linear-algebra/orth.m @@ -64,7 +64,7 @@ else - usage ("orth (a, tol"); + print_usage (); endif
--- a/scripts/linear-algebra/qzhess.m +++ b/scripts/linear-algebra/qzhess.m @@ -49,7 +49,7 @@ function [aa, bb, q, z] = qzhess (a, b) if (nargin != 2) - usage ("[aa, bb, q, z] = qzhess (a, b)"); + print_usage (); endif [na, ma] = size (a);
--- a/scripts/linear-algebra/rank.m +++ b/scripts/linear-algebra/rank.m @@ -48,7 +48,7 @@ sigma = svd (A); tolerance = tol; else - usage ("rank (A)"); + print_usage (); endif retval = sum (sigma > tolerance);
--- a/scripts/linear-algebra/trace.m +++ b/scripts/linear-algebra/trace.m @@ -27,7 +27,7 @@ function y = trace (x) if (nargin != 1) - usage ("trace (x)"); + print_usage (); endif [nr, nc] = size (x);
--- a/scripts/linear-algebra/vec.m +++ b/scripts/linear-algebra/vec.m @@ -33,7 +33,7 @@ function v = vec (x) if (nargin != 1) - usage ("vec (x)"); + print_usage (); endif v = x(:);
--- a/scripts/linear-algebra/vech.m +++ b/scripts/linear-algebra/vech.m @@ -34,7 +34,7 @@ function v = vech (x) if (nargin != 1) - usage ("vech (x)"); + print_usage (); endif if (! issquare (x))
--- a/scripts/miscellaneous/bincoeff.m +++ b/scripts/miscellaneous/bincoeff.m @@ -57,7 +57,7 @@ function b = bincoeff (n, k) if (nargin != 2) - usage ("bincoeff (n, k)"); + print_usage (); endif [retval, n, k] = common_size (n, k);
--- a/scripts/miscellaneous/delete.m +++ b/scripts/miscellaneous/delete.m @@ -31,7 +31,7 @@ if (nargin == 1) unlink (file); else - usage ("delete (file)"); + print_usage (); endif endfunction
--- a/scripts/miscellaneous/dir.m +++ b/scripts/miscellaneous/dir.m @@ -53,7 +53,7 @@ if (nargin == 0) file = "."; elseif (nargin > 1) - usage ("dir (file)"); + print_usage (); endif ## Prep the retval.
--- a/scripts/miscellaneous/dos.m +++ b/scripts/miscellaneous/dos.m @@ -34,7 +34,7 @@ function [status, text] = dos (cmd, echo_arg) if (nargin < 1 || nargin > 2) - usage ( "[status, text] = dos (cmd, '-echo')"); + print_usage (); elseif (! isunix ()) [status, text] = system (cmd); if (nargin > 1 || nargout == 0)
--- a/scripts/miscellaneous/fileattrib.m +++ b/scripts/miscellaneous/fileattrib.m @@ -132,7 +132,7 @@ endif endif else - usage ("fileattrib (file)"); + print_usage (); endif endfunction
--- a/scripts/miscellaneous/fileparts.m +++ b/scripts/miscellaneous/fileparts.m @@ -46,7 +46,7 @@ error ("fileparts: expecting filename argument to be a string"); endif else - usage ("fileparts (filename)"); + print_usage (); endif endfunction
--- a/scripts/miscellaneous/flops.m +++ b/scripts/miscellaneous/flops.m @@ -28,7 +28,7 @@ function retval = flops () if (nargin > 1) - usage ("flops () or flops (n)"); + print_usage (); endif warning ("flops is a flop, always returning zero");
--- a/scripts/miscellaneous/fullfile.m +++ b/scripts/miscellaneous/fullfile.m @@ -44,7 +44,7 @@ filename = strcat (filename, filesep, tmp); endfor else - usage ("fullfile (dir1, dir2, ..., file)"); + print_usage (); endif endfunction
--- a/scripts/miscellaneous/ispc.m +++ b/scripts/miscellaneous/ispc.m @@ -27,7 +27,7 @@ if (nargin == 0) retval = octave_config_info ("windows"); else - usage ("ispc ()"); + print_usage (); endif endfunction
--- a/scripts/miscellaneous/isunix.m +++ b/scripts/miscellaneous/isunix.m @@ -27,7 +27,7 @@ if (nargin == 0) retval = octave_config_info ("unix"); else - usage ("isunix ()"); + print_usage (); endif endfunction
--- a/scripts/miscellaneous/menu.m +++ b/scripts/miscellaneous/menu.m @@ -33,7 +33,7 @@ function num = menu (t, varargin) if (nargin < 2) - usage ("menu (title, opt1, ...)"); + print_usage (); endif ## Force pending output to appear before the menu.
--- a/scripts/miscellaneous/not.m +++ b/scripts/miscellaneous/not.m @@ -28,7 +28,7 @@ if (nargin == 1) retval = ! val; else - usage ("not (val)"); + print_usage (); endif endfunction
--- a/scripts/miscellaneous/popen2.m +++ b/scripts/miscellaneous/popen2.m @@ -121,7 +121,7 @@ error ("popen2: file name must be a string"); endif else - usage ("[in, out, pid] = popen2 (command, args)"); + print_usage (); endif endfunction
--- a/scripts/miscellaneous/single.m +++ b/scripts/miscellaneous/single.m @@ -31,7 +31,7 @@ if (nargin == 1 && isnumeric (val)) retval = val; else - usage ("single (val)"); + print_usage (); endif endfunction
--- a/scripts/miscellaneous/unix.m +++ b/scripts/miscellaneous/unix.m @@ -34,7 +34,7 @@ function [status, text] = unix (cmd, echo_arg) if (nargin < 1 || nargin > 2) - usage ( "[status, text] = unix (cmd, '-echo')"); + print_usage (); elseif (isunix ()) [status, text] = system (cmd); if (nargin > 1 || nargout == 0)
--- a/scripts/miscellaneous/ver.m +++ b/scripts/miscellaneous/ver.m @@ -30,7 +30,7 @@ function ver () if (nargin > 0) - usage ("ver"); + print_usage (); endif octave_license = license ();
--- a/scripts/miscellaneous/xor.m +++ b/scripts/miscellaneous/xor.m @@ -38,7 +38,7 @@ error ("xor: x and y must be of common size or scalars"); endif else - usage ("xor (x, y)"); + print_usage (); endif endfunction
--- a/scripts/optimization/glpk.m +++ b/scripts/optimization/glpk.m @@ -396,7 +396,7 @@ ## If there is no input output the version and syntax if (nargin < 3 || nargin > 9) - usage ("[xopt, fopt, status, extra] = glpk (c, a, b, lb, ub, ctype, vartype, sense, param)"); + print_usage (); return; endif
--- a/scripts/optimization/glpkmex.m +++ b/scripts/optimization/glpkmex.m @@ -28,7 +28,7 @@ ## If there is no input output the version and syntax if (nargin < 4 || nargin > 11) - usage ("[xopt, fopt, status, extra] = glpkmex (sense, c, a, b, ctype, lb, ub, vartype, param, lpsolver, savepb"); + print_usage (); return; endif
--- a/scripts/optimization/qp.m +++ b/scripts/optimization/qp.m @@ -275,7 +275,7 @@ INFO.info = info; else - usage ("[x, obj, info, lambda] = qp (x0, H, q, A, b, lb, ub, A_lb, Ain, A_ub)"); + print_usage (); endif endfunction
--- a/scripts/optimization/sqp.m +++ b/scripts/optimization/sqp.m @@ -421,7 +421,7 @@ else - usage ("[x, obj, info, iter, nf, lambda] = sqp (x, objf, cef, cif)"); + print_usage (); endif
--- a/scripts/plot/__axis_label__.m +++ b/scripts/plot/__axis_label__.m @@ -27,7 +27,7 @@ function h = __axis_label__ (caller, text) if (nargin == 0) - usage ("__axis_label__ (caller, text)"); + print_usage (); elseif (nargin == 2) if (ischar (text)) __gnuplot_raw__ (sprintf ("set %s \"%s\";\n", caller,
--- a/scripts/plot/__errplot__.m +++ b/scripts/plot/__errplot__.m @@ -40,7 +40,7 @@ __setup_plot__ ("__gnuplot_plot__"); if (nargin < 3 || nargin > 7) # at least three data arguments needed - usage ("__errplot__ (fmt, arg1, ...)"); + print_usage (); endif j = __plot_data_offset__{__current_figure__}(__multiplot_xi__,__multiplot_yi__);
--- a/scripts/plot/__plr1__.m +++ b/scripts/plot/__plr1__.m @@ -26,7 +26,7 @@ function __plr1__ (theta, fmt) if (nargin != 2) - usage ("__plr1__ (theta, fmt)"); + print_usage (); endif [nr, nc] = size (theta);
--- a/scripts/plot/__plr2__.m +++ b/scripts/plot/__plr2__.m @@ -26,7 +26,7 @@ function __plr2__ (theta, rho, fmt) if (nargin != 3) - usage ("__plr2__ (theta, rho, fmt)"); + print_usage (); endif if (any (imag (theta)))
--- a/scripts/plot/__plr__.m +++ b/scripts/plot/__plr__.m @@ -130,7 +130,7 @@ endif endif else - usage ("__plr__ (x, y)"); + print_usage (); endif endfunction
--- a/scripts/plot/__plt1__.m +++ b/scripts/plot/__plt1__.m @@ -26,7 +26,7 @@ function [data, fmtstr] = __plt1__ (x1, fmt) if (nargin < 1 || nargin > 2 || nargout != 2) - usage ("[data, fmtstr] = __plt1__ (x1, fmt)"); + print_usage (); endif if (nargin == 1)
--- a/scripts/plot/__plt2__.m +++ b/scripts/plot/__plt2__.m @@ -26,7 +26,7 @@ function [data, fmtstr] = __plt2__ (x1, x2, fmt) if (nargin < 2 || nargin > 3 || nargout != 2) - usage ("[data, fmtstr] = __plt2__ (x1, x2, fmt)"); + print_usage (); endif if (nargin == 2)
--- a/scripts/plot/__plt2mm__.m +++ b/scripts/plot/__plt2mm__.m @@ -26,7 +26,7 @@ function [data, fmtstr] = __plt2mm__ (x, y, fmt) if (nargin < 2 || nargin > 3 || nargout != 2) - usage ("[data, fmtstr] = __plt2mm__ (x, y, fmt)"); + print_usage (); elseif (nargin == 2 || isempty (fmt)) fmt = " "; ## Yes, this is intentionally not an empty string! endif
--- a/scripts/plot/__plt2mv__.m +++ b/scripts/plot/__plt2mv__.m @@ -26,7 +26,7 @@ function [data, fmtstr] = __plt2mv__ (x, y, fmt) if (nargin < 2 || nargin > 3 || nargout != 2) - usage ("[data, fmtstr] = __plt2mv__ (x, y, fmt)"); + print_usage (); elseif (nargin == 2 || isempty (fmt)) fmt = " "; ## Yes, this is intentionally not an empty string! endif
--- a/scripts/plot/__plt2ss__.m +++ b/scripts/plot/__plt2ss__.m @@ -26,7 +26,7 @@ function [data, fmtstr] = __plt2ss__ (x, y, fmt) if (nargin < 2 || nargin > 3 || nargout != 2) - usage ("[data, fmtstr] = __plt2ss__ (x, y, fmt)"); + print_usage (); elseif (nargin == 2) fmt = ""; elseif (rows (fmt) > 1)
--- a/scripts/plot/__plt2vm__.m +++ b/scripts/plot/__plt2vm__.m @@ -26,7 +26,7 @@ function [data, fmtstr] = __plt2vm__ (x, y, fmt) if (nargin < 2 || nargin > 3 || nargout != 2) - usage ("[data, fmtstr] = __plt2vm__ (x, y, fmt)"); + print_usage (); elseif (nargin == 2 || isempty (fmt)) fmt = " "; ## Yes, this is intentionally not an empty string! endif
--- a/scripts/plot/__plt2vv__.m +++ b/scripts/plot/__plt2vv__.m @@ -26,7 +26,7 @@ function [data, fmtstr] = __plt2vv__ (x, y, fmt) if (nargin < 2 || nargin > 3 || nargout != 2) - usage ("[data, fmtstr] = __plt2vv__ (x, y, fmt)"); + print_usage (); elseif (nargin == 2) fmt = ""; elseif (rows (fmt) > 1)
--- a/scripts/plot/__pltopt1__.m +++ b/scripts/plot/__pltopt1__.m @@ -61,7 +61,7 @@ TITLE = "title"; if (nargin != 2) - usage ("__pltopt1__ (caller, opt)"); + print_usage (); endif if (! ischar (opt))
--- a/scripts/plot/__pltopt__.m +++ b/scripts/plot/__pltopt__.m @@ -111,7 +111,7 @@ function fmt = __pltopt__ (caller, opt) if (! ischar (opt)) - usage ("__pltopt__ (caller, opt)"); + print_usage (); endif nr = rows (opt);
--- a/scripts/plot/bar.m +++ b/scripts/plot/bar.m @@ -111,7 +111,7 @@ error ("bar: arguments must be vectors"); endif else - usage ("[xb, yb] = bar (x, y)"); + print_usage (); endif if (nargout == 0)
--- a/scripts/plot/bottom_title.m +++ b/scripts/plot/bottom_title.m @@ -28,7 +28,7 @@ function bottom_title (text) if (nargin != 1) - usage ("bottom_title (text)"); + print_usage (); endif if (ischar (text))
--- a/scripts/plot/close.m +++ b/scripts/plot/close.m @@ -60,7 +60,7 @@ && ischar (arg2) && strcmp (arg2, "hidden")) closeplot; else - usage ("close [all]"); + print_usage (); endif if (nargout > 0)
--- a/scripts/plot/contour.m +++ b/scripts/plot/contour.m @@ -133,7 +133,7 @@ error ("contour: x and y must be vectors and z must be a matrix"); endif else - usage ("contour (x, y, z, levels) or contour (z, levels)"); + print_usage (); endif endfunction
--- a/scripts/plot/errorbar.m +++ b/scripts/plot/errorbar.m @@ -112,7 +112,7 @@ function errorbar (varargin) if (nargin < 2) - usage ("errorbar (...)"); + print_usage (); endif __gnuplot_raw__ ("set nologscale x;\n");
--- a/scripts/plot/figure.m +++ b/scripts/plot/figure.m @@ -53,7 +53,7 @@ warning ("figure: setting figure properties is unsupported"); endif else - usage ("figure (n)"); + print_usage (); endif endfunction
--- a/scripts/plot/fplot.m +++ b/scripts/plot/fplot.m @@ -35,7 +35,7 @@ function fplot (fn, limits, n) if (nargin < 2 || nargin > 3) - usage ("fplot (fn, limits, n)"); + print_usage (); endif if (nargin < 3)
--- a/scripts/plot/grid.m +++ b/scripts/plot/grid.m @@ -43,8 +43,6 @@ persistent minor_on = false; persistent minor_tics = 5; - usage_msg = "grid (\"on\" | \"off\")"; - do_replot = false; if (nargin == 0) @@ -84,7 +82,7 @@ endif do_replot = true; else - usage (usage_msg); + print_usage (); endif else error ("grid: argument must be a string"); @@ -109,7 +107,7 @@ __gnuplot_raw__ ("set grid xtics mxtics ytics mxtics;\n"); minor_on = true; else - usage (usage_msg); + print_usage (); endif do_replot = true; else @@ -123,17 +121,17 @@ minor_on = true; do_replot = true; else - usage (usage_msg); + print_usage ();; endif endif else - usage (usage_msg); + print_usage ();; endif else - usage (usage_msg); + print_usage ();; endif else - usage (usage_msg); + print_usage ();; endif if (do_replot && automatic_replot)
--- a/scripts/plot/hist.m +++ b/scripts/plot/hist.m @@ -46,7 +46,7 @@ function [nn, xx] = hist (y, x, norm) if (nargin < 1 || nargin > 3) - usage ("[nn, xx] = hist (y, x, norm)"); + print_usage (); endif arg_is_vector = isvector (y);
--- a/scripts/plot/hold.m +++ b/scripts/plot/hold.m @@ -54,8 +54,6 @@ __hold_state__(__current_figure__) = false; endif - usage_msg = "hold (\"on\") or hold (\"off\")"; - if (nargin == 0) __hold_state__(__current_figure__) = ! __hold_state__(__current_figure__); elseif (nargin == 1) @@ -64,10 +62,10 @@ elseif (strcmp (arg, "off")) __hold_state__(__current_figure__) = false; else - usage (usage_msg); + print_usage (); endif else - usage (usage_msg); + print_usage (); endif endfunction
--- a/scripts/plot/ishold.m +++ b/scripts/plot/ishold.m @@ -43,7 +43,7 @@ if (nargin == 0) retval = __hold_state__(__current_figure__); else - usage ("ishold ()"); + print_usage (); endif endfunction
--- a/scripts/plot/loglogerr.m +++ b/scripts/plot/loglogerr.m @@ -43,7 +43,7 @@ function loglogerr (varargin) if (nargin < 2) - usage ("loglogerr(...)"); + print_usage (); endif __gnuplot_raw__ ("set logscale x;\n");
--- a/scripts/plot/mesh.m +++ b/scripts/plot/mesh.m @@ -118,7 +118,7 @@ error ("mesh: x and y must be vectors and z must be a matrix"); endif else - usage ("mesh (z)"); + print_usage (); endif endfunction
--- a/scripts/plot/meshdom.m +++ b/scripts/plot/meshdom.m @@ -38,7 +38,7 @@ error ("meshdom: arguments must be vectors"); endif else - usage ("[xx, yy] = meshdom (x, y)"); + print_usage (); endif endfunction
--- a/scripts/plot/meshgrid.m +++ b/scripts/plot/meshgrid.m @@ -37,7 +37,7 @@ function [xx, yy, zz] = meshgrid (x, y, z) if (nargin == 0 || nargin > 3) - usage ("[xx, yy, zz] = meshgrid (x, y, z)"); + print_usage (); endif if (nargin < 2)
--- a/scripts/plot/multiplot.m +++ b/scripts/plot/multiplot.m @@ -44,7 +44,7 @@ global __multiplot_yi__; if (nargin != 2) - usage ("multiplot (xn, yn)"); + print_usage (); endif if (! (isscalar (xn) && isscalar (yn)))
--- a/scripts/plot/orient.m +++ b/scripts/plot/orient.m @@ -42,7 +42,7 @@ error ("orient: unknown orientation"); endif else - usage("orient ([\"portrait\"|\"landscape\"]) OR ret = orient ()"); + print_usage (); endif endfunction
--- a/scripts/plot/polar.m +++ b/scripts/plot/polar.m @@ -54,7 +54,7 @@ fmt = ""; __plr1__ (x1, fmt); else - usage ("polar (theta, rho, fmt)"); + print_usage (); endif endfunction
--- a/scripts/plot/replot.m +++ b/scripts/plot/replot.m @@ -36,7 +36,7 @@ eval (__plot_command__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}); endif else - usage ("replot ()"); + print_usage (); endif endfunction
--- a/scripts/plot/semilogxerr.m +++ b/scripts/plot/semilogxerr.m @@ -43,7 +43,7 @@ function semilogxerr (varargin) if (nargin < 2) - usage ("semilogxerr (...)"); + print_usage (); endif __gnuplot_raw__ ("set logscale x;\n");
--- a/scripts/plot/semilogyerr.m +++ b/scripts/plot/semilogyerr.m @@ -43,7 +43,7 @@ function semilogyerr (varargin) if (nargin < 2) - usage ("semilogyerr (...)"); + print_usage (); endif __gnuplot_raw__ ("set nologscale x;\n");
--- a/scripts/plot/sombrero.m +++ b/scripts/plot/sombrero.m @@ -47,7 +47,7 @@ error ("sombrero: number of grid lines must be greater than 1"); endif else - usage ("sombrero (n)"); + print_usage (); endif endfunction
--- a/scripts/plot/stairs.m +++ b/scripts/plot/stairs.m @@ -95,7 +95,7 @@ error ("stairs: arguments must be vectors"); endif else - usage ("[xs, ys] = stairs (x, y)"); + print_usage (); endif if (nargout == 0)
--- a/scripts/plot/subplot.m +++ b/scripts/plot/subplot.m @@ -86,7 +86,7 @@ __plot_globals__; if (nargin != 3 && nargin != 1) - usage ("subplot (rows, columns, index) or subplot (rcn)"); + print_usage (); endif if (nargin == 1)
--- a/scripts/plot/subwindow.m +++ b/scripts/plot/subwindow.m @@ -42,7 +42,7 @@ ## check calling argument count if (nargin != 2) - usage ("subwindow (xn, yn)"); + print_usage (); endif ## check for scalar inputs
--- a/scripts/plot/title.m +++ b/scripts/plot/title.m @@ -29,7 +29,7 @@ function h = title (text) if (nargin != 1) - usage ("title (text)"); + print_usage (); endif if (ischar (text))
--- a/scripts/plot/top_title.m +++ b/scripts/plot/top_title.m @@ -30,7 +30,7 @@ function top_title (text) if (nargin != 1) - usage ("top_title (text)"); + print_usage (); endif if (ischar (text))
--- a/scripts/polynomial/compan.m +++ b/scripts/polynomial/compan.m @@ -62,7 +62,7 @@ function A = compan (c) if (nargin != 1) - usage ("compan (vector)"); + print_usage (); endif if (! isvector (c))
--- a/scripts/polynomial/conv.m +++ b/scripts/polynomial/conv.m @@ -35,7 +35,7 @@ function y = conv (a, b) if (nargin != 2) - usage ("conv(a, b)"); + print_usage (); endif if (! (isvector (a) && isvector (b)))
--- a/scripts/polynomial/deconv.m +++ b/scripts/polynomial/deconv.m @@ -37,7 +37,7 @@ function [b, r] = deconv (y, a) if (nargin != 2) - usage ("deconv (y, a)"); + print_usage (); endif if (! (isvector (y) && isvector (a)))
--- a/scripts/polynomial/mkpp.m +++ b/scripts/polynomial/mkpp.m @@ -42,7 +42,7 @@ function pp = mkpp (x, P, d) if (nargin < 2 || nargin > 3) - usage ("pp = mkpp(x,P,d)"); + print_usage (); endif pp.x = x(:); pp.P = P;
--- a/scripts/polynomial/poly.m +++ b/scripts/polynomial/poly.m @@ -33,7 +33,7 @@ function y = poly (x) if (nargin != 1) - usage ("poly (x)"); + print_usage (); endif m = min (size (x)); @@ -46,7 +46,7 @@ elseif (m == n) v = eig (x); else - usage ("poly (x), where x is a vector or a square matrix"); + print_usage (); endif y = zeros (1, n+1);
--- a/scripts/polynomial/polyder.m +++ b/scripts/polynomial/polyder.m @@ -37,7 +37,7 @@ q = polyderiv (p, a); endif else - usage ("q = polyder (p) or q = polyder (b, a) or [q, r] = polyder (b, a)"); + print_usage (); endif endfunction
--- a/scripts/polynomial/polyderiv.m +++ b/scripts/polynomial/polyderiv.m @@ -86,7 +86,7 @@ q = p(1:(lp-1)) .* [(lp-1):-1:1]; endif else - usage ("q = polyderiv (p) or q = polyderiv (b, a) or [q, r] = polyderiv (b, a)"); + print_usage (); endif
--- a/scripts/polynomial/polyfit.m +++ b/scripts/polynomial/polyfit.m @@ -61,7 +61,7 @@ if (nargin != 3) - usage ("polyfit (x, y, n)"); + print_usage (); endif if (! (isvector (x) && isvector (y) && size (x) == size (y)))
--- a/scripts/polynomial/polygcd.m +++ b/scripts/polynomial/polygcd.m @@ -67,7 +67,7 @@ endwhile endif else - usage ("x = polygcd (b, a [,tol])"); + print_usage (); endif endfunction
--- a/scripts/polynomial/polyinteg.m +++ b/scripts/polynomial/polyinteg.m @@ -34,7 +34,7 @@ function p = polyinteg (p) if(nargin != 1) - usage ("polyinteg (vector)"); + print_usage (); endif if (! (isvector (p) || isempty (p)))
--- a/scripts/polynomial/polyout.m +++ b/scripts/polynomial/polyout.m @@ -44,7 +44,7 @@ function y = polyout (c, x) if (nargin < 1) || (nargin > 2) || (nargout < 0) || (nargout > 1) - usage("polyout (c, x)"); + print_usage (); endif if (! isvector (c))
--- a/scripts/polynomial/polyreduce.m +++ b/scripts/polynomial/polyreduce.m @@ -32,7 +32,7 @@ function p = polyreduce (p) if (nargin != 1) - usage ("polyreduce (p)"); + print_usage (); endif if (! (isvector (p) || isempty (p)))
--- a/scripts/polynomial/polyval.m +++ b/scripts/polynomial/polyval.m @@ -37,7 +37,7 @@ function y = polyval (c, x) if (nargin != 2) - usage ("polyval (c, x)"); + print_usage (); endif if (! (isvector (c) || isempty (c)))
--- a/scripts/polynomial/polyvalm.m +++ b/scripts/polynomial/polyvalm.m @@ -37,7 +37,7 @@ function y = polyvalm (c, x) if (nargin != 2) - usage ("polyvalm (c, x)"); + print_usage (); endif if (! (isvector (c) || isempty (c)))
--- a/scripts/polynomial/ppval.m +++ b/scripts/polynomial/ppval.m @@ -29,7 +29,7 @@ function yi = ppval (pp, xi) if (nargin != 2) - usage ("yi = ppval(pp, xi)") + print_usage (); endif if (! isstruct (pp)) error ("ppval: expects a pp structure");
--- a/scripts/polynomial/residue.m +++ b/scripts/polynomial/residue.m @@ -170,7 +170,7 @@ ## We then solve for the residues using matrix division. if (nargin < 2 || nargin > 3) - usage ("residue (b, a, toler)"); + print_usage (); endif if (nargin == 2)
--- a/scripts/polynomial/roots.m +++ b/scripts/polynomial/roots.m @@ -44,7 +44,7 @@ function r = roots (v) if (min (size (v)) > 1 || nargin != 1) - usage ("roots (v), where v is a vector"); + print_usage (); endif n = length (v);
--- a/scripts/polynomial/unmkpp.m +++ b/scripts/polynomial/unmkpp.m @@ -48,7 +48,7 @@ function [x, P, n, k, d] = unmkpp (pp) if (nargin == 0) - usage ("[x, P, n, k, d] = unmkpp(pp)") + print_usage (); endif if (! isstruct (pp)) error ("unmkpp: expecting piecewise polynomial structure");
--- a/scripts/quaternion/quaternion.m +++ b/scripts/quaternion/quaternion.m @@ -70,12 +70,12 @@ a = vv; b = theta; otherwise - usage ("[a, b, c, d] = quaternion (w) or [vv, theta] = quaternion (w)"); + print_usage (); endswitch case(2) if (nargout != 1) - usage ("w = quaterion (vv, theta)"); + print_usage (); endif vv = w; theta = x; @@ -101,7 +101,7 @@ case(4) if (nargout != 1) - usage ("w = quaterion (a, b, c, d)"); + print_usage (); endif if (! (isscalar (w) && isscalar (x) && isscalar (y) && isscalar (z))) error ("input values must be scalars"); @@ -109,7 +109,7 @@ a = [w, x, y, z]; otherwise - usage ("[a, b, c, d] = quaternion (w) or a = quaternion (w, x, y, z)"); + print_usage (); endswitch
--- a/scripts/set/complement.m +++ b/scripts/set/complement.m @@ -36,7 +36,7 @@ function y = complement (a, b) if (nargin != 2) - usage ("complement(a,b)"); + print_usage (); endif if (isempty (a))
--- a/scripts/set/create_set.m +++ b/scripts/set/create_set.m @@ -36,7 +36,7 @@ function y = create_set(x) if (nargin != 1) - usage ("create_set(x)"); + print_usage (); endif if (isempty(x))
--- a/scripts/set/intersect.m +++ b/scripts/set/intersect.m @@ -33,7 +33,7 @@ function [c, ia, ib] = intersect (a, b) if (nargin != 2) - usage ("intersect (a, b)"); + print_usage (); endif if (isempty (a) || isempty (b))
--- a/scripts/set/ismember.m +++ b/scripts/set/ismember.m @@ -30,7 +30,7 @@ function c = ismember (a, S) if (nargin != 2) - usage ("ismember (A, S)"); + print_usage (); endif [ra, ca] = size (a);
--- a/scripts/set/setdiff.m +++ b/scripts/set/setdiff.m @@ -35,7 +35,7 @@ function c = setdiff (a, b, byrows) if (nargin < 2 || nargin > 3) - usage ("setdiff (a, b) or setdiff (a, b, \"rows\")"); + print_usage (); endif if (nargin == 3)
--- a/scripts/set/setxor.m +++ b/scripts/set/setxor.m @@ -29,7 +29,7 @@ function c = setxor (a, b) if (nargin != 2) - usage ("setxor(a,b)"); + print_usage (); endif ## Form A and B into sets.
--- a/scripts/set/union.m +++ b/scripts/set/union.m @@ -36,7 +36,7 @@ function y = union(a,b) if (nargin != 2) - usage ("union(a,b)"); + print_usage (); endif if (isempty (a))
--- a/scripts/set/unique.m +++ b/scripts/set/unique.m @@ -36,7 +36,7 @@ function [y, i, j] = unique (x, r) if (nargin < 1 || nargin > 2 || (nargin == 2 && ! strcmp (r, "rows"))) - usage ("unique (x) or unique (x, 'rows')"); + print_usage (); endif if (nargin == 1)
--- a/scripts/signal/arch_fit.m +++ b/scripts/signal/arch_fit.m @@ -52,7 +52,7 @@ function [a, b] = arch_fit (y, X, p, ITER, gamma, a0, b0) if ((nargin < 3) || (nargin == 6) || (nargin > 7)) - usage ("arch_fit (y, X, p, ITER, gamma, a0, b0)"); + print_usage (); endif if (! (isvector (y)))
--- a/scripts/signal/arch_rnd.m +++ b/scripts/signal/arch_rnd.m @@ -42,7 +42,7 @@ function y = arch_rnd (a, b, T) if (nargin != 3) - usage ("arch_rnd (a, b, T)"); + print_usage (); endif if (! ((min (size (a)) == 1) && (min (size (b)) == 1)))
--- a/scripts/signal/arma_rnd.m +++ b/scripts/signal/arma_rnd.m @@ -49,7 +49,7 @@ error ("arma_rnd: n must be a scalar"); endif else - usage ("arma_rnd (a, b, v, t, n)"); + print_usage (); endif if ((min (size (a)) > 1) || (min (size (b)) > 1))
--- a/scripts/signal/autocor.m +++ b/scripts/signal/autocor.m @@ -35,7 +35,7 @@ elseif (nargin == 2) retval = autocov (X, h); else - usage ("autocor (X, h)"); + print_usage (); endif if (min (retval (1,:)) != 0)
--- a/scripts/signal/autoreg_matrix.m +++ b/scripts/signal/autoreg_matrix.m @@ -33,7 +33,7 @@ function X = autoreg_matrix (y, k) if (nargin != 2) - usage ("autoreg_matrix (y, k)"); + print_usage (); endif if (! (isvector (y)))
--- a/scripts/signal/bartlett.m +++ b/scripts/signal/bartlett.m @@ -32,7 +32,7 @@ function c = bartlett (m) if (nargin != 1) - usage ("bartlett (m)"); + print_usage (); endif if (! (isscalar (m) && (m == round (m)) && (m > 0)))
--- a/scripts/signal/blackman.m +++ b/scripts/signal/blackman.m @@ -31,7 +31,7 @@ function c = blackman (m) if (nargin != 1) - usage ("blackman (m)"); + print_usage (); endif if (! (isscalar (m) && (m == round (m)) && (m > 0)))
--- a/scripts/signal/detrend.m +++ b/scripts/signal/detrend.m @@ -42,7 +42,7 @@ error ("detrend: p must be a nonnegative integer"); endif else - usage ("detrend (x, p)"); + print_usage (); endif [m, n] = size (x);
--- a/scripts/signal/diffpara.m +++ b/scripts/signal/diffpara.m @@ -43,7 +43,7 @@ function [d, D] = diffpara (X, a, b) if ((nargin < 1) || (nargin > 3)) - usage ("[d, D] = diffpara (X, a, b)"); + print_usage (); else if (isvector (X)) n = length (X);
--- a/scripts/signal/durbinlevinson.m +++ b/scripts/signal/durbinlevinson.m @@ -36,7 +36,7 @@ function [newphi, newv] = durbinlevinson (c, oldphi, oldv) if (! ((nargin == 1) || (nargin == 3))) - usage ("durbinlevinson (c, oldphi, oldv)"); + print_usage (); endif if (columns (c) > 1)
--- a/scripts/signal/fftconv.m +++ b/scripts/signal/fftconv.m @@ -35,7 +35,7 @@ function c = fftconv (a, b, N) if (nargin < 2 || nargin > 3) - usage ("fftconv (b, x, N)"); + print_usage (); endif if (! (isvector (a) && isvector (b)))
--- a/scripts/signal/fftfilt.m +++ b/scripts/signal/fftfilt.m @@ -42,7 +42,7 @@ ## one blocks, but if the user knows better ... if (nargin < 2 || nargin > 3) - usage (" fftfilt (b, x, N)"); + print_usage (); endif transpose = (rows (x) == 1);
--- a/scripts/signal/fftshift.m +++ b/scripts/signal/fftshift.m @@ -48,7 +48,7 @@ retval = 0; if (nargin != 1 && nargin != 2) - usage ("usage: fftshift (X, dim)"); + print_usage (); endif if (nargin == 2)
--- a/scripts/signal/filter2.m +++ b/scripts/signal/filter2.m @@ -45,7 +45,7 @@ function Y = filter2 (B, X, shape) if (nargin < 2 || nargin > 3) - usage ("Y = filter2 (B, X [, 'shape'])"); + print_usage (); endif if (nargin < 3) shape = "same";
--- a/scripts/signal/freqz.m +++ b/scripts/signal/freqz.m @@ -73,7 +73,7 @@ function [h_r, f_r] = freqz (b, a, n, region, Fs) if (nargin < 1 || nargin > 5) - usage ("[h, w] = freqz (b, a, n [, \"whole\"] [, Fs])"); + print_usage (); elseif (nargin == 1) ## Response of an FIR filter. a = n = region = Fs = [];
--- a/scripts/signal/hamming.m +++ b/scripts/signal/hamming.m @@ -31,7 +31,7 @@ function c = hamming (m) if (nargin != 1) - usage ("hamming (m)"); + print_usage (); endif if (! (isscalar (m) && (m == round (m)) && (m > 0)))
--- a/scripts/signal/hanning.m +++ b/scripts/signal/hanning.m @@ -31,7 +31,7 @@ function c = hanning (m) if (nargin != 1) - usage ("hanning (m)"); + print_usage (); endif if (! (isscalar (m) && (m == round (m)) && (m > 0)))
--- a/scripts/signal/hurst.m +++ b/scripts/signal/hurst.m @@ -30,7 +30,7 @@ function H = hurst (x) if (nargin != 1) - usage ("hurst (x)"); + print_usage (); endif if (isscalar (x))
--- a/scripts/signal/ifftshift.m +++ b/scripts/signal/ifftshift.m @@ -34,7 +34,7 @@ retval = 0; if (nargin != 1 && nargin != 2) - usage ("usage: ifftshift (X, dim)"); + print_usage (); endif if (nargin == 2)
--- a/scripts/signal/sinetone.m +++ b/scripts/signal/sinetone.m @@ -41,7 +41,7 @@ elseif (nargin == 3) a = 64; elseif ((nargin < 1) || (nargin > 4)) - usage ("sinetone (freq, rate, sec, ampl)"); + print_usage (); endif [err, f, a] = common_size (f, a);
--- a/scripts/signal/sinewave.m +++ b/scripts/signal/sinewave.m @@ -40,7 +40,7 @@ endif x = sin (((1 : m) + d - 1) * 2 * pi / n); else - usage ("sinewave (m, n, d)"); + print_usage (); endif endfunction
--- a/scripts/signal/spencer.m +++ b/scripts/signal/spencer.m @@ -29,7 +29,7 @@ function retval = spencer (X) if (nargin != 1) - usage ("spencer (X)"); + print_usage (); endif [xr, xc] = size(X);
--- a/scripts/signal/stft.m +++ b/scripts/signal/stft.m @@ -81,7 +81,7 @@ endif endif else - usage ("[Y, c] = stft(X, win_size, inc, num_coef, w_type)"); + print_usage (); endif ## check whether X is a vector
--- a/scripts/signal/synthesis.m +++ b/scripts/signal/synthesis.m @@ -36,7 +36,7 @@ function X = synthesis (Y, c) if (nargin != 2) - usage ("X = synthesis (Y, c)"); + print_usage (); endif [nr, nc] = size (c);
--- a/scripts/signal/unwrap.m +++ b/scripts/signal/unwrap.m @@ -33,7 +33,7 @@ function retval = unwrap (a, tol, dim) if (nargin < 1 || nargin > 3) - usage ("unwrap (a [, tol [, dim]])") + print_usage (); endif nd = ndims (a);
--- a/scripts/sparse/gplot.m +++ b/scripts/sparse/gplot.m @@ -34,7 +34,7 @@ function [x, y] = gplot (A, xy, line_style) if (nargin < 2 || nargin > 3 || nargout > 2) - usage ("gplot (a, xy, line_style)"); + print_usage (); endif if (nargin == 2)
--- a/scripts/sparse/spfun.m +++ b/scripts/sparse/spfun.m @@ -25,7 +25,7 @@ function t = spfun(f,s) if (nargin != 2) - usage ("spfun(f,s)") + print_usage (); endif if issparse(s)
--- a/scripts/sparse/sprand.m +++ b/scripts/sparse/sprand.m @@ -52,6 +52,6 @@ S = sparse(i,j+1,rand(k,1),m,n); endif else - usage("sprand(m,n,density) OR sprand(S)"); + print_usage (); endif endfunction
--- a/scripts/sparse/sprandn.m +++ b/scripts/sparse/sprandn.m @@ -44,6 +44,6 @@ S = sparse(i,j+1,randn(k,1),m,n); endif else - usage("sprandn(m,n,density) OR sprandn(S)"); + print_usage (); endif endfunction
--- a/scripts/sparse/sprandsym.m +++ b/scripts/sparse/sprandsym.m @@ -70,6 +70,6 @@ S = S + tril(S,-1)'; endif else - usage("sprandsym(n,density) OR sprandsym(S)"); + print_usage (); endif endfunction
--- a/scripts/sparse/spstats.m +++ b/scripts/sparse/spstats.m @@ -18,7 +18,7 @@ function [count,mean,var] = spstats(S,j) if nargin < 1 || nargin > 2 - usage("[count, mean, var] = spstats(S) OR spstats(x,j)"); + print_usage (); endif if nargin == 1
--- a/scripts/specfun/beta.m +++ b/scripts/specfun/beta.m @@ -42,7 +42,7 @@ function retval = beta (a, b) if (nargin != 2) - usage ("beta (a, b)"); + print_usage (); endif retval = exp (gammaln (a) + gammaln (b) - gammaln (a+b));
--- a/scripts/specfun/betai.m +++ b/scripts/specfun/betai.m @@ -34,7 +34,7 @@ if (nargin == 3) retval = betainc (x, a, b); else - usage ("betai (a, b, x)"); + print_usage (); endif endfunction
--- a/scripts/specfun/betaln.m +++ b/scripts/specfun/betaln.m @@ -42,7 +42,7 @@ function retval = betaln (a, b) if (nargin != 2) - usage ("betaln (a, b)"); + print_usage (); endif retval = gammaln (a) + gammaln (b) - gammaln (a + b);
--- a/scripts/specfun/erfinv.m +++ b/scripts/specfun/erfinv.m @@ -30,7 +30,7 @@ function [y, iterations] = erfinv (x) if (nargin != 1) - usage ("erfinv (x)"); + print_usage (); endif maxit = 100;
--- a/scripts/specfun/gammai.m +++ b/scripts/specfun/gammai.m @@ -34,7 +34,7 @@ if (nargin == 2) retval = gammainc (x, a); else - usage ("gammai (a, x)"); + print_usage (); endif endfunction
--- a/scripts/specfun/log2.m +++ b/scripts/specfun/log2.m @@ -40,7 +40,7 @@ function [f, e] = log2 (x) if (nargin != 1) - usage ("y = log2 (x) or [f, e] = log2 (x)"); + print_usage (); endif if (nargout < 2)
--- a/scripts/specfun/pow2.m +++ b/scripts/specfun/pow2.m @@ -52,7 +52,7 @@ elseif (nargin == 2) y = f .* (2 .^ e); else - usage ("y = pow2 (f, e)"); + print_usage (); endif endfunction
--- a/scripts/special-matrix/hankel.m +++ b/scripts/special-matrix/hankel.m @@ -53,7 +53,7 @@ if (nargin == 1) r = resize (resize (c, 0), size(c)); elseif (nargin != 2) - usage ("hankel (c, r)"); + print_usage (); endif [c_nr, c_nc] = size (c);
--- a/scripts/special-matrix/hilb.m +++ b/scripts/special-matrix/hilb.m @@ -51,7 +51,7 @@ if (nargin != 1) - usage ("hilb (n)"); + print_usage (); endif nmax = length (n);
--- a/scripts/special-matrix/invhilb.m +++ b/scripts/special-matrix/invhilb.m @@ -69,7 +69,7 @@ function retval = invhilb (n) if (nargin != 1) - usage ("invhilb (n)"); + print_usage (); endif nmax = length (n);
--- a/scripts/special-matrix/sylvester_matrix.m +++ b/scripts/special-matrix/sylvester_matrix.m @@ -36,7 +36,7 @@ function retval = sylvester_matrix (k) if (nargin != 1) - usage ("sylvester_matrix (n)"); + print_usage (); endif if (isscalar (k))
--- a/scripts/special-matrix/toeplitz.m +++ b/scripts/special-matrix/toeplitz.m @@ -61,7 +61,7 @@ if (nargin == 1) r = c; elseif (nargin != 2) - usage ("toeplitz (c, r)"); + print_usage (); endif [c_nr, c_nc] = size (c);
--- a/scripts/special-matrix/vander.m +++ b/scripts/special-matrix/vander.m @@ -53,7 +53,7 @@ function retval = vander (c) if (nargin != 1) - usage ("vander (c)"); + print_usage (); endif if (isvector (c))
--- a/scripts/statistics/base/center.m +++ b/scripts/statistics/base/center.m @@ -32,7 +32,7 @@ function retval = center (x, varargin) if (nargin != 1 && nargin != 2) - usage ("center (x)"); + print_usage (); endif if (isvector (x))
--- a/scripts/statistics/base/cloglog.m +++ b/scripts/statistics/base/cloglog.m @@ -32,7 +32,7 @@ function y = cloglog (x) if (nargin != 1) - usage ("cloglog (x)"); + print_usage (); endif y = - log (- log (x));
--- a/scripts/statistics/base/cor.m +++ b/scripts/statistics/base/cor.m @@ -35,7 +35,7 @@ function retval = cor (x, y) if (nargin < 1 || nargin > 2) - usage ("cor (x, y)"); + print_usage (); endif if (nargin == 2)
--- a/scripts/statistics/base/corrcoef.m +++ b/scripts/statistics/base/corrcoef.m @@ -33,7 +33,7 @@ function retval = corrcoef (x, y) if (nargin < 1 || nargin > 2) - usage ("corrcoef (x, y)"); + print_usage (); endif if (nargin == 2)
--- a/scripts/statistics/base/cov.m +++ b/scripts/statistics/base/cov.m @@ -32,7 +32,7 @@ function c = cov (x, y) if (nargin < 1 || nargin > 2) - usage ("cov (x, y)"); + print_usage (); endif if (rows (x) == 1)
--- a/scripts/statistics/base/cut.m +++ b/scripts/statistics/base/cut.m @@ -38,7 +38,7 @@ function group = cut (X, BREAKS) if (nargin != 2) - usage ("cut (X, BREAKS)"); + print_usage (); endif if (! isvector (X))
--- a/scripts/statistics/base/gls.m +++ b/scripts/statistics/base/gls.m @@ -69,7 +69,7 @@ function [BETA, v, R] = gls (Y, X, O) if (nargin != 3) - usage ("[BETA, v, R] = gls (Y, X, O)"); + print_usage (); endif [rx, cx] = size (X);
--- a/scripts/statistics/base/iqr.m +++ b/scripts/statistics/base/iqr.m @@ -33,7 +33,7 @@ function y = iqr (x, dim) if (nargin != 1 && nargin != 2) - usage ("iqr (x, dim)"); + print_usage (); endif nd = ndims (x);
--- a/scripts/statistics/base/kendall.m +++ b/scripts/statistics/base/kendall.m @@ -70,7 +70,7 @@ function tau = kendall (x, y) if ((nargin < 1) || (nargin > 2)) - usage ("kendall (x, y)"); + print_usage (); endif if (rows (x) == 1)
--- a/scripts/statistics/base/kurtosis.m +++ b/scripts/statistics/base/kurtosis.m @@ -48,7 +48,7 @@ function retval = kurtosis (x, dim) if (nargin != 1 && nargin != 2) - usage ("kurtosis (x, dim)"); + print_usage (); endif nd = ndims (x);
--- a/scripts/statistics/base/logit.m +++ b/scripts/statistics/base/logit.m @@ -31,7 +31,7 @@ if (nargin == 1) y = logistic_inv (p); else - usage ("logit (p)"); + print_usage (); endif endfunction \ No newline at end of file
--- a/scripts/statistics/base/mahalanobis.m +++ b/scripts/statistics/base/mahalanobis.m @@ -32,7 +32,7 @@ function retval = mahalanobis (X, Y) if (nargin != 2) - usage ("mahalanobis (X, Y)"); + print_usage (); endif [xr, xc] = size (X);
--- a/scripts/statistics/base/mean.m +++ b/scripts/statistics/base/mean.m @@ -81,10 +81,10 @@ opt = opt2; dim = opt1; else - usage ("mean: expecting opt to be a string"); + error ("mean: expecting opt to be a string"); endif else - usage ("mean (x, dim, opt) or mean (x, dim, opt)"); + print_usage (); endif if (need_dim)
--- a/scripts/statistics/base/meansq.m +++ b/scripts/statistics/base/meansq.m @@ -32,7 +32,7 @@ function y = meansq (x, varargin) if (nargin != 1 && nargin != 2) - usage ("meansq (x)"); + print_usage (); endif y = mean (x.^2, varargin{:});
--- a/scripts/statistics/base/median.m +++ b/scripts/statistics/base/median.m @@ -50,7 +50,7 @@ function retval = median (a, dim) if (nargin != 1 && nargin != 2) - usage ("median (a, dim)"); + print_usage (); endif if (nargin < 2) dim = find (size (a) > 1, 1);
--- a/scripts/statistics/base/moment.m +++ b/scripts/statistics/base/moment.m @@ -48,7 +48,7 @@ function m = moment (x, p, opt1, opt2) if ((nargin < 2) || (nargin > 4)) - usage ("moment (x, p, type, dim)"); + print_usage (); endif need_dim = 0; @@ -72,10 +72,10 @@ opt = opt2; dim = opt1; else - usage ("moment: expecting opt to be a string"); + error ("moment: expecting opt to be a string"); endif else - usage ("moment (x, p, dim, opt)"); + print_usage (); endif if (need_dim)
--- a/scripts/statistics/base/ols.m +++ b/scripts/statistics/base/ols.m @@ -80,7 +80,7 @@ function [BETA, SIGMA, R] = ols (Y, X) if (nargin != 2) - usage ("[BETA, SIGMA, R] = ols (Y, X)"); + print_usage (); endif [nr, nc] = size (X);
--- a/scripts/statistics/base/ppplot.m +++ b/scripts/statistics/base/ppplot.m @@ -46,7 +46,7 @@ function [p, y] = ppplot (x, dist, varargin) if (nargin < 1) - usage ("ppplot (x, dist, params)"); + print_usage (); endif if (! isvector (x))
--- a/scripts/statistics/base/probit.m +++ b/scripts/statistics/base/probit.m @@ -31,7 +31,7 @@ if (nargin == 1) y = stdnormal_inv (p); else - usage ("probit (p)"); + print_usage (); endif endfunction
--- a/scripts/statistics/base/qqplot.m +++ b/scripts/statistics/base/qqplot.m @@ -48,7 +48,7 @@ function [q, s] = qqplot (x, dist, varargin) if (nargin < 1) - usage ("qqplot (x, dist, params)"); + print_usage (); endif if (! (isvector(x)))
--- a/scripts/statistics/base/range.m +++ b/scripts/statistics/base/range.m @@ -35,7 +35,7 @@ function y = range (x, varargin) if (nargin != 1 && nargin != 2) - usage ("range (x, dim)"); + print_usage (); endif y = max (x, varargin{:}) - min (x, varargin{:});
--- a/scripts/statistics/base/ranks.m +++ b/scripts/statistics/base/ranks.m @@ -37,7 +37,7 @@ function y = ranks (x, dim) if (nargin != 1 && nargin != 2) - usage ("ranks (x, dim)"); + print_usage (); endif nd = ndims (x);
--- a/scripts/statistics/base/run_count.m +++ b/scripts/statistics/base/run_count.m @@ -31,7 +31,7 @@ function retval = run_count (x, n, dim) if (nargin != 2 && nargin != 3) - usage ("run_count (x, n) or run_count (x, n, dim)"); + print_usage (); endif nd = ndims (x);
--- a/scripts/statistics/base/skewness.m +++ b/scripts/statistics/base/skewness.m @@ -47,7 +47,7 @@ function retval = skewness (x, dim) if (nargin != 1 && nargin != 2) - usage ("skewness (x, dim)"); + print_usage (); endif nd = ndims (x);
--- a/scripts/statistics/base/spearman.m +++ b/scripts/statistics/base/spearman.m @@ -42,7 +42,7 @@ function rho = spearman (x, y) if ((nargin < 1) || (nargin > 2)) - usage ("spearman (x, y)"); + print_usage (); endif if (rows (x) == 1)
--- a/scripts/statistics/base/statistics.m +++ b/scripts/statistics/base/statistics.m @@ -32,7 +32,7 @@ function S = statistics (X, dim) if (nargin != 1 && nargin != 2) - usage ("S = statistics (X, dim)"); + print_usage (); endif nd = ndims (X);
--- a/scripts/statistics/base/std.m +++ b/scripts/statistics/base/std.m @@ -63,7 +63,7 @@ function retval = std (a, opt, dim) if (nargin < 1 || nargin > 3) - usage ("std (a, opt, dim)"); + print_usage (); endif if nargin < 3 dim = find (size (a) > 1, 1);
--- a/scripts/statistics/base/studentize.m +++ b/scripts/statistics/base/studentize.m @@ -33,7 +33,7 @@ function t = studentize (x, dim) if (nargin != 1 && nargin != 2) - usage ("studentize (x, dim)"); + print_usage (); endif nd = ndims (x);
--- a/scripts/statistics/base/table.m +++ b/scripts/statistics/base/table.m @@ -52,7 +52,7 @@ endfor endfor else - usage ("[t, l_x, ...] = table (x, ...)"); + print_usage (); endif endfunction \ No newline at end of file
--- a/scripts/statistics/base/values.m +++ b/scripts/statistics/base/values.m @@ -29,7 +29,7 @@ function v = values (x) if (nargin != 1) - usage ("values (x)"); + print_usage (); endif if (! (isvector (x)))
--- a/scripts/statistics/base/var.m +++ b/scripts/statistics/base/var.m @@ -44,7 +44,7 @@ function y = var (x, opt, dim) if (nargin < 1 || nargin > 3) - usage ("var (x, opt, sim)"); + print_usage (); endif if (nargin < 3) dim = find (size (x) > 1, 1);
--- a/scripts/statistics/distributions/betacdf.m +++ b/scripts/statistics/distributions/betacdf.m @@ -30,7 +30,7 @@ function cdf = betacdf (x, a, b) if (nargin != 3) - usage ("betacdf (a, b, x)"); + print_usage (); endif if (!isscalar (a) || !isscalar(b))
--- a/scripts/statistics/distributions/betainv.m +++ b/scripts/statistics/distributions/betainv.m @@ -30,7 +30,7 @@ function inv = betainv (x, a, b) if (nargin != 3) - usage ("betainv (x, a, b)"); + print_usage (); endif if (!isscalar (a) || !isscalar(b))
--- a/scripts/statistics/distributions/betapdf.m +++ b/scripts/statistics/distributions/betapdf.m @@ -29,7 +29,7 @@ function pdf = betapdf (x, a, b) if (nargin != 3) - usage ("betapdf (a, b, x)"); + print_usage (); endif if (!isscalar (a) || !isscalar(b))
--- a/scripts/statistics/distributions/betarnd.m +++ b/scripts/statistics/distributions/betarnd.m @@ -72,7 +72,7 @@ elseif (nargin == 2) sz = size(a); else - usage ("betarnd (a, b, r, c)"); + print_usage (); endif if (isscalar(a) && isscalar(b))
--- a/scripts/statistics/distributions/binocdf.m +++ b/scripts/statistics/distributions/binocdf.m @@ -29,7 +29,7 @@ function cdf = binocdf (x, n, p) if (nargin != 3) - usage ("binocdf (x, n, p)"); + print_usage (); endif if (!isscalar (n) || !isscalar (p))
--- a/scripts/statistics/distributions/binoinv.m +++ b/scripts/statistics/distributions/binoinv.m @@ -29,7 +29,7 @@ function inv = binoinv (x, n, p) if (nargin != 3) - usage ("binoinv (x, n, p)"); + print_usage (); endif if (!isscalar (n) || !isscalar (p))
--- a/scripts/statistics/distributions/binopdf.m +++ b/scripts/statistics/distributions/binopdf.m @@ -30,7 +30,7 @@ function pdf = binopdf (x, n, p) if (nargin != 3) - usage ("binopdf (x, n, p)"); + print_usage (); endif if (! isscalar (n) || ! isscalar (p))
--- a/scripts/statistics/distributions/binornd.m +++ b/scripts/statistics/distributions/binornd.m @@ -72,7 +72,7 @@ elseif (nargin == 2) sz = size(n); else - usage ("binornd (n, p, r, c)"); + print_usage (); endif if (isscalar (n) && isscalar (p))
--- a/scripts/statistics/distributions/cauchy_cdf.m +++ b/scripts/statistics/distributions/cauchy_cdf.m @@ -31,7 +31,7 @@ function cdf = cauchy_cdf (x, location, scale) if (! (nargin == 1 || nargin == 3)) - usage ("cauchy_cdf (x, lambda, sigma)"); + print_usage (); endif if (nargin == 1)
--- a/scripts/statistics/distributions/cauchy_inv.m +++ b/scripts/statistics/distributions/cauchy_inv.m @@ -31,7 +31,7 @@ function inv = cauchy_inv (x, location, scale) if (! (nargin == 1 || nargin == 3)) - usage ("cauchy_inv (x, lambda, sigma)"); + print_usage (); endif if (nargin == 1)
--- a/scripts/statistics/distributions/cauchy_pdf.m +++ b/scripts/statistics/distributions/cauchy_pdf.m @@ -31,7 +31,7 @@ function pdf = cauchy_pdf (x, location, scale) if (! (nargin == 1 || nargin == 3)) - usage ("cauchy_pdf (x, lambda, sigma)"); + print_usage (); endif if (nargin == 1)
--- a/scripts/statistics/distributions/cauchy_rnd.m +++ b/scripts/statistics/distributions/cauchy_rnd.m @@ -71,7 +71,7 @@ elseif (nargin == 2) sz = size(l); else - usage ("cauchy_rnd (lambda, sigma, r, c)"); + print_usage (); endif if (isscalar (l) && isscalar (scale))
--- a/scripts/statistics/distributions/chi2cdf.m +++ b/scripts/statistics/distributions/chi2cdf.m @@ -30,7 +30,7 @@ function cdf = chi2cdf (x, n) if (nargin != 2) - usage ("chi2cdf (x, n)"); + print_usage (); endif if (!isscalar (n))
--- a/scripts/statistics/distributions/chi2inv.m +++ b/scripts/statistics/distributions/chi2inv.m @@ -30,7 +30,7 @@ function inv = chi2inv (x, n) if (nargin != 2) - usage ("chi2inv (x, n)"); + print_usage (); endif if (!isscalar (n))
--- a/scripts/statistics/distributions/chi2pdf.m +++ b/scripts/statistics/distributions/chi2pdf.m @@ -30,7 +30,7 @@ function pdf = chi2pdf (x, n) if (nargin != 2) - usage ("chi2pdf (x, n)"); + print_usage (); endif if (!isscalar (n))
--- a/scripts/statistics/distributions/chi2rnd.m +++ b/scripts/statistics/distributions/chi2rnd.m @@ -62,7 +62,7 @@ elseif (nargin == 1) sz = size(n); else - usage ("chi2rnd (n, r, c)"); + print_usage (); endif if (isscalar (n))
--- a/scripts/statistics/distributions/discrete_cdf.m +++ b/scripts/statistics/distributions/discrete_cdf.m @@ -30,7 +30,7 @@ function cdf = discrete_cdf (x, v, p) if (nargin != 3) - usage ("discrete_cdf (x, v, p)"); + print_usage (); endif sz = size (x);
--- a/scripts/statistics/distributions/discrete_inv.m +++ b/scripts/statistics/distributions/discrete_inv.m @@ -30,7 +30,7 @@ function inv = discrete_inv (x, v, p) if (nargin != 3) - usage ("discrete_inv (x, v, p)"); + print_usage (); endif sz = size (x);
--- a/scripts/statistics/distributions/discrete_pdf.m +++ b/scripts/statistics/distributions/discrete_pdf.m @@ -30,7 +30,7 @@ function pdf = discrete_pdf (x, v, p) if (nargin != 3) - usage ("discrete_pdf (x, v, p)"); + print_usage (); endif sz = size (x);
--- a/scripts/statistics/distributions/discrete_rnd.m +++ b/scripts/statistics/distributions/discrete_rnd.m @@ -63,7 +63,7 @@ endif endif else - usage ("discrete_rnd (n, v, p) | discrete_rnd (v, p, r, c)"); + print_usage (); endif if (! isvector (v))
--- a/scripts/statistics/distributions/empirical_rnd.m +++ b/scripts/statistics/distributions/empirical_rnd.m @@ -41,7 +41,7 @@ r = 1; endif elseif (nargin != 3) - usage ("empirical_rnd (n, data) | empirical_rnd (data, r, c)"); + print_usage (); endif if (! isvector (data))
--- a/scripts/statistics/distributions/expcdf.m +++ b/scripts/statistics/distributions/expcdf.m @@ -32,7 +32,7 @@ function cdf = expcdf (x, l) if (nargin != 2) - usage ("expcdf (x, lambda)"); + print_usage (); endif if (!isscalar (x) && !isscalar(l))
--- a/scripts/statistics/distributions/expinv.m +++ b/scripts/statistics/distributions/expinv.m @@ -30,7 +30,7 @@ function inv = expinv (x, l) if (nargin != 2) - usage ("expinv (x, lambda)"); + print_usage (); endif if (!isscalar (x) && !isscalar(l))
--- a/scripts/statistics/distributions/exppdf.m +++ b/scripts/statistics/distributions/exppdf.m @@ -29,7 +29,7 @@ function pdf = exppdf (x, l) if (nargin != 2) - usage ("exppdf (x, lambda)"); + print_usage (); endif if (!isscalar (x) && !isscalar(l))
--- a/scripts/statistics/distributions/exprnd.m +++ b/scripts/statistics/distributions/exprnd.m @@ -63,7 +63,7 @@ elseif (nargin == 1) sz = size (l); else - usage ("exprnd (lambda, r, c)"); + print_usage (); endif
--- a/scripts/statistics/distributions/fcdf.m +++ b/scripts/statistics/distributions/fcdf.m @@ -30,7 +30,7 @@ function cdf = fcdf (x, m, n) if (nargin != 3) - usage ("fcdf (x, m, n)"); + print_usage (); endif if (!isscalar (m) || !isscalar (n))
--- a/scripts/statistics/distributions/finv.m +++ b/scripts/statistics/distributions/finv.m @@ -30,7 +30,7 @@ function inv = finv (x, m, n) if (nargin != 3) - usage ("finv (x, m, n)"); + print_usage (); endif if (!isscalar (m) || !isscalar (n))
--- a/scripts/statistics/distributions/fpdf.m +++ b/scripts/statistics/distributions/fpdf.m @@ -30,7 +30,7 @@ function pdf = fpdf (x, m, n) if (nargin != 3) - usage ("fpdf (x, m, n)"); + print_usage (); endif if (!isscalar (m) || !isscalar (n))
--- a/scripts/statistics/distributions/frnd.m +++ b/scripts/statistics/distributions/frnd.m @@ -74,7 +74,7 @@ elseif (nargin == 2) sz = size(a); else - usage ("frnd (m, n, r, c)"); + print_usage (); endif
--- a/scripts/statistics/distributions/gamcdf.m +++ b/scripts/statistics/distributions/gamcdf.m @@ -31,7 +31,7 @@ function cdf = gamcdf (x, a, b) if (nargin != 3) - usage ("gamcdf (x, a, b)"); + print_usage (); endif if (!isscalar (a) || !isscalar(b))
--- a/scripts/statistics/distributions/gaminv.m +++ b/scripts/statistics/distributions/gaminv.m @@ -31,7 +31,7 @@ function inv = gaminv (x, a, b) if (nargin != 3) - usage ("gaminv (x, a, b)"); + print_usage (); endif if (!isscalar (a) || !isscalar(b))
--- a/scripts/statistics/distributions/gampdf.m +++ b/scripts/statistics/distributions/gampdf.m @@ -31,7 +31,7 @@ function pdf = gampdf (x, a, b) if (nargin != 3) - usage ("gampdf (x, a, b)"); + print_usage (); endif if (!isscalar (a) || !isscalar(b))
--- a/scripts/statistics/distributions/gamrnd.m +++ b/scripts/statistics/distributions/gamrnd.m @@ -73,7 +73,7 @@ elseif (nargin == 2) sz = size(a); else - usage ("gamrnd (a, b, r, c)"); + print_usage (); endif rnd = zeros (sz);
--- a/scripts/statistics/distributions/geocdf.m +++ b/scripts/statistics/distributions/geocdf.m @@ -29,7 +29,7 @@ function cdf = geocdf (x, p) if (nargin != 2) - usage ("geocdf (x, p)"); + print_usage (); endif if (!isscalar (x) && !isscalar (p))
--- a/scripts/statistics/distributions/geoinv.m +++ b/scripts/statistics/distributions/geoinv.m @@ -29,7 +29,7 @@ function inv = geoinv (x, p) if (nargin != 2) - usage ("geoinv (x, p)"); + print_usage (); endif if (!isscalar (x) && !isscalar (p))
--- a/scripts/statistics/distributions/geopdf.m +++ b/scripts/statistics/distributions/geopdf.m @@ -29,7 +29,7 @@ function pdf = geopdf (x, p) if (nargin != 2) - usage ("geopdf (x, p)"); + print_usage (); endif if (!isscalar (x) && !isscalar (p))
--- a/scripts/statistics/distributions/geornd.m +++ b/scripts/statistics/distributions/geornd.m @@ -63,7 +63,7 @@ elseif (nargin == 1) sz = size(n); elseif (nargin != 1) - usage ("geornd (p, r, c)"); + print_usage (); endif
--- a/scripts/statistics/distributions/hygecdf.m +++ b/scripts/statistics/distributions/hygecdf.m @@ -36,7 +36,7 @@ function cdf = hygecdf (x, m, t, n) if (nargin != 4) - usage ("hygecdf (x, m, t, n)"); + print_usage (); endif if (!isscalar (m) || !isscalar (t) || !isscalar (n))
--- a/scripts/statistics/distributions/hygeinv.m +++ b/scripts/statistics/distributions/hygeinv.m @@ -33,7 +33,7 @@ function inv = hygeinv (x, m, t, n) if (nargin != 4) - usage ("hygeinv (x, m, t, n)"); + print_usage (); endif if (!isscalar (m) || !isscalar (t) || !isscalar (n))
--- a/scripts/statistics/distributions/hygepdf.m +++ b/scripts/statistics/distributions/hygepdf.m @@ -34,7 +34,7 @@ function pdf = hygepdf (x, m, t, n) if (nargin != 4) - usage ("hygepdf (x, m, t, n)"); + print_usage (); endif if (!isscalar (m) || !isscalar (t) || !isscalar (n))
--- a/scripts/statistics/distributions/hygernd.m +++ b/scripts/statistics/distributions/hygernd.m @@ -57,7 +57,7 @@ error ("hygernd: r must be a vector of positive integers"); endif else - usage ("hygernd (N, m, t, n) | hygernd (m, t, n, r, c)"); + print_usage (); endif if (!isscalar (m) || !isscalar (t) || !isscalar (n))
--- a/scripts/statistics/distributions/kolmogorov_smirnov_cdf.m +++ b/scripts/statistics/distributions/kolmogorov_smirnov_cdf.m @@ -46,7 +46,7 @@ function cdf = kolmogorov_smirnov_cdf (x, tol) if (nargin < 1 || nargin > 2) - usage ("kolmogorov_smirnov_cdf (x, tol)"); + print_usage (); endif if (nargin == 1)
--- a/scripts/statistics/distributions/laplace_cdf.m +++ b/scripts/statistics/distributions/laplace_cdf.m @@ -29,7 +29,7 @@ function cdf = laplace_cdf (x) if (nargin != 1) - usage ("laplace_cdf (x)"); + print_usage (); endif cdf = zeros (size (x));
--- a/scripts/statistics/distributions/laplace_inv.m +++ b/scripts/statistics/distributions/laplace_inv.m @@ -29,7 +29,7 @@ function inv = laplace_inv (x) if (nargin != 1) - usage ("laplace_inv (x)"); + print_usage (); endif inv = (-Inf) * ones (size (x));
--- a/scripts/statistics/distributions/laplace_pdf.m +++ b/scripts/statistics/distributions/laplace_pdf.m @@ -29,7 +29,7 @@ function pdf = laplace_pdf (x) if (nargin != 1) - usage ("laplace_pdf (x)"); + print_usage (); endif pdf = zeros (size (x));
--- a/scripts/statistics/distributions/laplace_rnd.m +++ b/scripts/statistics/distributions/laplace_rnd.m @@ -47,7 +47,7 @@ error ("laplace_rnd: r must be a postive integer or vector"); endif else - usage ("laplace_rnd (r, c)"); + print_usage (); endif tmp = rand (sz);
--- a/scripts/statistics/distributions/logistic_cdf.m +++ b/scripts/statistics/distributions/logistic_cdf.m @@ -29,7 +29,7 @@ function cdf = logistic_cdf (x) if (nargin != 1) - usage ("logistic_cdf (x)"); + print_usage (); endif cdf = 1 ./ (1 + exp (- x));
--- a/scripts/statistics/distributions/logistic_inv.m +++ b/scripts/statistics/distributions/logistic_inv.m @@ -29,7 +29,7 @@ function inv = logistic_inv (x) if (nargin != 1) - usage ("logistic_inv (x)"); + print_usage (); endif inv = zeros (size (x));
--- a/scripts/statistics/distributions/logistic_pdf.m +++ b/scripts/statistics/distributions/logistic_pdf.m @@ -29,7 +29,7 @@ function pdf = logistic_pdf (x) if (nargin != 1) - usage ("logistic_pdf (x)"); + print_usage (); endif cdf = logistic_cdf (x);
--- a/scripts/statistics/distributions/logistic_rnd.m +++ b/scripts/statistics/distributions/logistic_rnd.m @@ -48,7 +48,7 @@ error ("logistic_rnd: r must be a postive integer or vector"); endif else - usage ("logistic_rnd (r, c)"); + print_usage (); endif rnd = - log (1 ./ rand (sz) - 1);
--- a/scripts/statistics/distributions/logncdf.m +++ b/scripts/statistics/distributions/logncdf.m @@ -34,7 +34,7 @@ function cdf = logncdf (x, mu, sigma) if (! ((nargin == 1) || (nargin == 3))) - usage ("logncdf (x, mu, sigma)"); + print_usage (); endif if (nargin == 1)
--- a/scripts/statistics/distributions/logninv.m +++ b/scripts/statistics/distributions/logninv.m @@ -34,7 +34,7 @@ function inv = logninv (x, mu, sigma) if (! ((nargin == 1) || (nargin == 3))) - usage ("logninv (x, mu, sigma)"); + print_usage (); endif if (nargin == 1)
--- a/scripts/statistics/distributions/lognpdf.m +++ b/scripts/statistics/distributions/lognpdf.m @@ -34,7 +34,7 @@ function pdf = lognpdf (x, mu, sigma) if (! ((nargin == 1) || (nargin == 3))) - usage ("lognpdf (x, mu, sigma)"); + print_usage (); endif if (nargin == 1)
--- a/scripts/statistics/distributions/lognrnd.m +++ b/scripts/statistics/distributions/lognrnd.m @@ -74,7 +74,7 @@ elseif (nargin == 2) sz = size(mu); else - usage ("lognrnd (mu, sigma, r, c)"); + print_usage (); endif if (isscalar (mu) && isscalar (sigma))
--- a/scripts/statistics/distributions/normcdf.m +++ b/scripts/statistics/distributions/normcdf.m @@ -32,7 +32,7 @@ function cdf = normcdf (x, m, v) if (! ((nargin == 1) || (nargin == 3))) - usage ("normcdf (x, m, v)"); + print_usage (); endif if (nargin == 1)
--- a/scripts/statistics/distributions/norminv.m +++ b/scripts/statistics/distributions/norminv.m @@ -32,7 +32,7 @@ function inv = norminv (x, m, v) if (nargin != 1 && nargin != 3) - usage ("norminv (x, m, v)"); + print_usage (); endif if (nargin == 1)
--- a/scripts/statistics/distributions/normpdf.m +++ b/scripts/statistics/distributions/normpdf.m @@ -32,7 +32,7 @@ function pdf = normpdf (x, m, v) if (nargin != 1 && nargin != 3) - usage ("normpdf (x, m, v)"); + print_usage (); endif if (nargin == 1)
--- a/scripts/statistics/distributions/normrnd.m +++ b/scripts/statistics/distributions/normrnd.m @@ -72,7 +72,7 @@ elseif (nargin == 2) sz = size(m); else - usage ("normrnd (m, v, r, c)"); + print_usage (); endif if (isscalar (m) && isscalar (v))
--- a/scripts/statistics/distributions/pascal_cdf.m +++ b/scripts/statistics/distributions/pascal_cdf.m @@ -33,7 +33,7 @@ function cdf = pascal_cdf (x, n, p) if (nargin != 3) - usage ("pascal_cdf (x, n, p)"); + print_usage (); endif if (!isscalar(n) || !isscalar(p))
--- a/scripts/statistics/distributions/pascal_inv.m +++ b/scripts/statistics/distributions/pascal_inv.m @@ -34,7 +34,7 @@ function inv = pascal_inv (x, n, p) if (nargin != 3) - usage ("pascal_inv (x, n, p)"); + print_usage (); endif if (!isscalar(n) || !isscalar(p))
--- a/scripts/statistics/distributions/pascal_pdf.m +++ b/scripts/statistics/distributions/pascal_pdf.m @@ -34,7 +34,7 @@ function pdf = pascal_pdf (x, n, p) if (nargin != 3) - usage ("pascal_pdf (x, n, p)"); + print_usage (); endif if (!isscalar(n) || !isscalar(p))
--- a/scripts/statistics/distributions/pascal_rnd.m +++ b/scripts/statistics/distributions/pascal_rnd.m @@ -73,7 +73,7 @@ elseif (nargin == 2) sz = size(n); else - usage ("pascal_rnd (n, p, r, c)"); + print_usage (); endif if (isscalar (n) && isscalar (p))
--- a/scripts/statistics/distributions/poisscdf.m +++ b/scripts/statistics/distributions/poisscdf.m @@ -30,7 +30,7 @@ function cdf = poisscdf (x, l) if (nargin != 2) - usage ("poisscdf (x, lambda)"); + print_usage (); endif if (!isscalar (l))
--- a/scripts/statistics/distributions/poissinv.m +++ b/scripts/statistics/distributions/poissinv.m @@ -30,7 +30,7 @@ function inv = poissinv (x, l) if (nargin != 2) - usage ("poissinv (x, lambda)"); + print_usage (); endif if (!isscalar (l))
--- a/scripts/statistics/distributions/poisspdf.m +++ b/scripts/statistics/distributions/poisspdf.m @@ -29,7 +29,7 @@ function pdf = poisspdf (x, l) if (nargin != 2) - usage ("poisspdf (x, lambda)"); + print_usage (); endif if (!isscalar (l))
--- a/scripts/statistics/distributions/poissrnd.m +++ b/scripts/statistics/distributions/poissrnd.m @@ -61,7 +61,7 @@ elseif (nargin == 1) sz = size (l); else - usage ("poissrnd (lambda, r, c)"); + print_usage (); endif if (isscalar (l))
--- a/scripts/statistics/distributions/stdnormal_cdf.m +++ b/scripts/statistics/distributions/stdnormal_cdf.m @@ -29,7 +29,7 @@ function cdf = stdnormal_cdf (x) if (nargin != 1) - usage ("stdnormal_cdf (x)"); + print_usage (); endif sz = size (x);
--- a/scripts/statistics/distributions/stdnormal_inv.m +++ b/scripts/statistics/distributions/stdnormal_inv.m @@ -29,7 +29,7 @@ function inv = stdnormal_inv (x) if (nargin != 1) - usage ("stdnormal_inv (x)"); + print_usage (); endif inv = sqrt (2) * erfinv (2 * x - 1);
--- a/scripts/statistics/distributions/stdnormal_pdf.m +++ b/scripts/statistics/distributions/stdnormal_pdf.m @@ -29,7 +29,7 @@ function pdf = stdnormal_pdf (x) if (nargin != 1) - usage ("stdnormal_pdf (x)"); + print_usage (); endif sz = size(x);
--- a/scripts/statistics/distributions/stdnormal_rnd.m +++ b/scripts/statistics/distributions/stdnormal_rnd.m @@ -30,7 +30,7 @@ function rnd = stdnormal_rnd (r, c) if (nargin != 1 && nargin != 2) - usage ("stdnormal_rnd (r, c)"); + print_usage (); endif if (nargin == 2)
--- a/scripts/statistics/distributions/tcdf.m +++ b/scripts/statistics/distributions/tcdf.m @@ -30,7 +30,7 @@ function cdf = tcdf (x, n) if (nargin != 2) - usage ("tcdf (x, n)"); + print_usage (); endif if (!isscalar (n))
--- a/scripts/statistics/distributions/tinv.m +++ b/scripts/statistics/distributions/tinv.m @@ -34,7 +34,7 @@ function inv = tinv (x, n) if (nargin != 2) - usage ("tinv (x, n)"); + print_usage (); endif if (!isscalar (n))
--- a/scripts/statistics/distributions/tpdf.m +++ b/scripts/statistics/distributions/tpdf.m @@ -30,7 +30,7 @@ function pdf = tpdf (x, n) if (nargin != 2) - usage ("tpdf (x, n)"); + print_usage (); endif if (!isscalar (n))
--- a/scripts/statistics/distributions/trnd.m +++ b/scripts/statistics/distributions/trnd.m @@ -63,7 +63,7 @@ elseif (nargin == 1) sz = size (n); else - usage ("trnd (n, r, c)"); + print_usage (); endif if (isscalar (n))
--- a/scripts/statistics/distributions/unifcdf.m +++ b/scripts/statistics/distributions/unifcdf.m @@ -31,7 +31,7 @@ function cdf = unifcdf (x, a, b) if (nargin != 1 && nargin != 3) - usage ("unifcdf (x, a, b)"); + print_usage (); endif if (nargin == 1)
--- a/scripts/statistics/distributions/unifinv.m +++ b/scripts/statistics/distributions/unifinv.m @@ -31,7 +31,7 @@ function inv = unifinv (x, a, b) if (nargin != 1 && nargin != 3) - usage ("unifinv (x, a, b)"); + print_usage (); endif if (nargin == 1)
--- a/scripts/statistics/distributions/unifpdf.m +++ b/scripts/statistics/distributions/unifpdf.m @@ -31,7 +31,7 @@ function pdf = unifpdf (x, a, b) if (nargin != 1 && nargin != 3) - usage ("unifpdf (x, a, b)"); + print_usage (); endif if (nargin == 1)
--- a/scripts/statistics/distributions/unifrnd.m +++ b/scripts/statistics/distributions/unifrnd.m @@ -71,7 +71,7 @@ elseif (nargin == 2) sz = size(a); else - usage ("unifrnd (a, b, r, c)"); + print_usage (); endif if (isscalar(a) && isscalar(b))
--- a/scripts/statistics/distributions/wblcdf.m +++ b/scripts/statistics/distributions/wblcdf.m @@ -37,7 +37,7 @@ function cdf = wblcdf (x, scale, shape) if (nargin < 1 || nargin > 3) - usage ("wblcdf (x, scale, shape)"); + print_usage (); endif if (nargin < 3)
--- a/scripts/statistics/distributions/wblinv.m +++ b/scripts/statistics/distributions/wblinv.m @@ -30,7 +30,7 @@ function inv = wblinv (x, scale, shape) if (nargin < 1 || nargin > 3) - usage ("wblinv (x, scale, shape)"); + print_usage (); endif if (nargin < 3)
--- a/scripts/statistics/distributions/wblpdf.m +++ b/scripts/statistics/distributions/wblpdf.m @@ -37,7 +37,7 @@ function pdf = wblpdf (x, scale, shape) if (nargin < 1 || nargin > 3) - usage ("wblpdf (x, scale, shape)"); + print_usage (); endif if (nargin < 3)
--- a/scripts/statistics/distributions/wblrnd.m +++ b/scripts/statistics/distributions/wblrnd.m @@ -74,7 +74,7 @@ elseif (nargin == 2) sz = size(shape); else - usage ("wblrnd (alpha, sigma, r, c)"); + print_usage (); endif if (isscalar (shape) && isscalar (scale))
--- a/scripts/statistics/distributions/wienrnd.m +++ b/scripts/statistics/distributions/wienrnd.m @@ -40,7 +40,7 @@ elseif (nargin == 2) n = 1000; elseif (nargin > 3) - usage ("wienrnd (t, d, n)"); + print_usage (); endif if (!isscalar (t) || !isscalar (d) || !isscalar (n))
--- a/scripts/statistics/tests/anova.m +++ b/scripts/statistics/tests/anova.m @@ -48,7 +48,7 @@ function [pval, f, df_b, df_w] = anova (y, g) if ((nargin < 1) || (nargin > 2)) - usage ("anova (y, g)"); + print_usage (); elseif (nargin == 1) if (isvector (y)) error ("anova: for `anova (y)', y must not be a vector");
--- a/scripts/statistics/tests/bartlett_test.m +++ b/scripts/statistics/tests/bartlett_test.m @@ -39,7 +39,7 @@ k = nargin; if (k < 2) - usage ("[pval, chisq, df] = bartlett_test (x1, ...)"); + print_usage (); endif f = zeros (k, 1);
--- a/scripts/statistics/tests/chisquare_test_homogeneity.m +++ b/scripts/statistics/tests/chisquare_test_homogeneity.m @@ -40,7 +40,7 @@ function [pval, chisq, df] = chisquare_test_homogeneity (x, y, c) if (nargin != 3) - usage ("[pval, chisq, df] = chisquare_test_homogeneity (x, y, c)"); + print_usage (); endif if (! (isvector(x) && isvector(y) && isvector(c)))
--- a/scripts/statistics/tests/chisquare_test_independence.m +++ b/scripts/statistics/tests/chisquare_test_independence.m @@ -36,7 +36,7 @@ function [pval, chisq, df] = chisquare_test_independence (X) if (nargin != 1) - usage ("chisquare_test_independence (X)"); + print_usage (); endif [r, s] = size (X);
--- a/scripts/statistics/tests/cor_test.m +++ b/scripts/statistics/tests/cor_test.m @@ -64,7 +64,7 @@ function t = cor_test (X, Y, ALTERNATIVE, METHOD) if ((nargin < 2) || (nargin > 4)) - usage ("cor_test (X, Y, ALTERNATIVE, METHOD)") + print_usage (); endif if (!isvector (X) || !isvector (Y) || length (X) != length (Y))
--- a/scripts/statistics/tests/f_test_regression.m +++ b/scripts/statistics/tests/f_test_regression.m @@ -39,7 +39,7 @@ function [pval, f, df_num, df_den] = f_test_regression (y, X, R, r) if (nargin < 3 || nargin > 4) - usage ("[pval, f, df_num, df_den] = f_test_regression (y, X, R, r)"); + print_usage (); endif [T, k] = size (X);
--- a/scripts/statistics/tests/hotelling_test.m +++ b/scripts/statistics/tests/hotelling_test.m @@ -39,7 +39,7 @@ function [pval, Tsq] = hotelling_test (x, m) if (nargin != 2) - usage ("hotelling_test (x, m)"); + print_usage (); endif if (isvector (x))
--- a/scripts/statistics/tests/hotelling_test_2.m +++ b/scripts/statistics/tests/hotelling_test_2.m @@ -46,7 +46,7 @@ function [pval, Tsq] = hotelling_test_2 (x, y) if (nargin != 2) - usage ("hotelling_test_2 (x, y)"); + print_usage (); endif if (isvector (x))
--- a/scripts/statistics/tests/kolmogorov_smirnov_test.m +++ b/scripts/statistics/tests/kolmogorov_smirnov_test.m @@ -53,7 +53,7 @@ function [pval, ks] = kolmogorov_smirnov_test (x, dist, varargin) if (nargin < 2) - usage ("[pval, ks] = kolmogorov_smirnov_test (x, dist,, params, alt)"); + print_usage (); endif if (! isvector (x))
--- a/scripts/statistics/tests/kolmogorov_smirnov_test_2.m +++ b/scripts/statistics/tests/kolmogorov_smirnov_test_2.m @@ -49,7 +49,7 @@ function [pval, ks, d] = kolmogorov_smirnov_test_2 (x, y, alt) if (nargin < 2 || nargin > 3) - usage ("[pval, ks] = kolmogorov_smirnov_test_2 (x, y, tol)"); + print_usage (); endif if (! (isvector (x) && isvector (y)))
--- a/scripts/statistics/tests/kruskal_wallis_test.m +++ b/scripts/statistics/tests/kruskal_wallis_test.m @@ -42,7 +42,7 @@ m = nargin; if (m < 2) - usage ("[pval, k, df] = kruskal_wallis_test (x1, ...)"); + print_usage (); endif n = [];
--- a/scripts/statistics/tests/manova.m +++ b/scripts/statistics/tests/manova.m @@ -44,7 +44,7 @@ function manova (Y, g) if (nargin != 2) - usage ("manova (Y, g)"); + print_usage (); endif if (isvector (Y))
--- a/scripts/statistics/tests/mcnemar_test.m +++ b/scripts/statistics/tests/mcnemar_test.m @@ -38,7 +38,7 @@ function [pval, chisq, df] = mcnemar_test (x) if (nargin != 1) - usage ("mcnemar_test (x)"); + print_usage (); endif if (! (min (size (x)) > 1) && issquare (x))
--- a/scripts/statistics/tests/prop_test_2.m +++ b/scripts/statistics/tests/prop_test_2.m @@ -44,7 +44,7 @@ function [pval, z] = prop_test_2 (x1, n1, x2, n2, alt) if ((nargin < 4) || (nargin > 5)) - usage ("[pval, z] = prop_test_2 (x1, n1, x2, n2, alt)"); + print_usage (); endif ## Could do sanity checking on x1, n1, x2, n2 here
--- a/scripts/statistics/tests/run_test.m +++ b/scripts/statistics/tests/run_test.m @@ -34,7 +34,7 @@ function [pval, chisq] = run_test (x) if (nargin != 1) - usage ("run_test (x)"); + print_usage (); endif A = [4529.4, 9044.9, 13568, 18091, 22615, 27892;
--- a/scripts/statistics/tests/sign_test.m +++ b/scripts/statistics/tests/sign_test.m @@ -46,7 +46,7 @@ function [pval, b, n] = sign_test (x, y, alt) if ((nargin < 2) || (nargin > 3)) - usage ("[pval, b, n] = sign_test (x, y, alt)"); + print_usage (); endif if (! (isvector (x) && isvector (y) && (length (x) == length (y))))
--- a/scripts/statistics/tests/t_test.m +++ b/scripts/statistics/tests/t_test.m @@ -45,7 +45,7 @@ function [pval, t, df] = t_test (x, m, alt) if ((nargin < 2) || (nargin > 3)) - usage ("[pval, t, df] = t_test (x, m, alt)"); + print_usage (); endif if (! isvector (x))
--- a/scripts/statistics/tests/t_test_2.m +++ b/scripts/statistics/tests/t_test_2.m @@ -45,7 +45,7 @@ function [pval, t, df] = t_test_2 (x, y, alt) if ((nargin < 2) || (nargin > 3)) - usage ("[pval, t, df] = t_test_2 (x, y, alt)"); + print_usage (); endif if (! (isvector (x) && isvector (y)))
--- a/scripts/statistics/tests/t_test_regression.m +++ b/scripts/statistics/tests/t_test_regression.m @@ -55,7 +55,7 @@ alt = "!="; endif elseif (! (nargin == 5)) - usage ("[pval, t, df] = t_test_regression (y, X, R, r, alt)"); + print_usage (); endif if (! isscalar (r))
--- a/scripts/statistics/tests/u_test.m +++ b/scripts/statistics/tests/u_test.m @@ -47,7 +47,7 @@ function [pval, z] = u_test (x, y, alt) if ((nargin < 2) || (nargin > 3)) - usage ("[pval, z] = u_test (x, y, alt)"); + print_usage (); endif if (! (isvector (x) && isvector (y)))
--- a/scripts/statistics/tests/var_test.m +++ b/scripts/statistics/tests/var_test.m @@ -44,7 +44,7 @@ function [pval, f, df_num, df_den] = var_test (x, y, alt) if ((nargin < 2) || (nargin > 3)) - usage ("[pval, f, df_num, df_den] = var_test (x, y, alt)"); + print_usage (); endif if (! (isvector (x) && isvector (y)))
--- a/scripts/statistics/tests/welch_test.m +++ b/scripts/statistics/tests/welch_test.m @@ -44,7 +44,7 @@ function [pval, t, df] = welch_test (x, y, alt) if ((nargin < 2) || (nargin > 3)) - usage ("[pval, t, df] = welch_test (x, y, alt)"); + print_usage (); endif if (! (isvector (x) && isvector (y)))
--- a/scripts/statistics/tests/wilcoxon_test.m +++ b/scripts/statistics/tests/wilcoxon_test.m @@ -43,7 +43,7 @@ function [pval, z] = wilcoxon_test (x, y, alt) if ((nargin < 2) || (nargin > 3)) - usage ("[pval, z] = wilcoxon_test (x, y, alt)"); + print_usage (); endif if (! (isvector (x) && isvector (y) && (length (x) == length (y))))
--- a/scripts/statistics/tests/z_test.m +++ b/scripts/statistics/tests/z_test.m @@ -45,7 +45,7 @@ function [pval, z] = z_test (x, m, v, alt) if ((nargin < 3) || (nargin > 4)) - usage ("[pval, z] = z_test (x, m, v, alt)"); + print_usage (); endif if (! isvector (x))
--- a/scripts/statistics/tests/z_test_2.m +++ b/scripts/statistics/tests/z_test_2.m @@ -45,7 +45,7 @@ function [pval, z] = z_test_2 (x, y, v_x, v_y, alt) if ((nargin < 4) || (nargin > 5)) - usage ("[pval, z] = z_test_2 (x, y, v_x, v_y, alt)"); + print_usage (); endif if (! (isvector (x) && isvector (y)))
--- a/scripts/strings/base2dec.m +++ b/scripts/strings/base2dec.m @@ -49,7 +49,7 @@ function out = base2dec (d, base) if (nargin != 2) - usage ("n = base2dec('d', base)"); + print_usage (); endif symbols = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
--- a/scripts/strings/blanks.m +++ b/scripts/strings/blanks.m @@ -28,7 +28,7 @@ function s = blanks (n) if (nargin != 1) - usage ("blanks (n)"); + print_usage (); endif if (isscalar (n) && n == round (n))
--- a/scripts/strings/deblank.m +++ b/scripts/strings/deblank.m @@ -31,7 +31,7 @@ function s = deblank (s) if (nargin != 1) - usage ("deblank (s)"); + print_usage (); endif if (ischar (s))
--- a/scripts/strings/dec2base.m +++ b/scripts/strings/dec2base.m @@ -50,7 +50,7 @@ function retval = dec2base (n, base, len) if (nargin < 2 || nargin > 3) - usage ("dec2base (n, base [, len])"); + print_usage (); endif if (prod (size (n)) != length (n))
--- a/scripts/strings/dec2bin.m +++ b/scripts/strings/dec2bin.m @@ -45,7 +45,7 @@ elseif (nargin == 2) retval = dec2base (n, 2, len); else - usage ("dec2bin (n [, len])"); + print_usage (); endif endfunction
--- a/scripts/strings/dec2hex.m +++ b/scripts/strings/dec2hex.m @@ -45,7 +45,7 @@ elseif (nargin == 2) retval = dec2base (n, 16, len); else - usage ("dec2hex (n [, len])"); + print_usage (); endif endfunction
--- a/scripts/strings/findstr.m +++ b/scripts/strings/findstr.m @@ -41,7 +41,7 @@ function v = findstr (s, t, overlap) if (nargin < 2 || nargin > 3) - usage ("findstr (s, t, overlap)"); + print_usage (); endif if (all (size (s) > 1) || all (size (t) > 1))
--- a/scripts/strings/hex2dec.m +++ b/scripts/strings/hex2dec.m @@ -40,7 +40,7 @@ function d = hex2dec (h) if (nargin != 1) - usage ("hex2dec (b)"); + print_usage (); else d = base2dec (h, 16); endif
--- a/scripts/strings/index.m +++ b/scripts/strings/index.m @@ -38,7 +38,7 @@ ## This is patterned after the AWK function of the same name. if (nargin != 2) - usage ("index (s, t)"); + print_usage (); endif if (!ischar (s) || !ischar (t) || all (size (s) > 1) || all (size (t) > 1) )
--- a/scripts/strings/isletter.m +++ b/scripts/strings/isletter.m @@ -28,7 +28,7 @@ function retval = isletter (s) if (nargin != 1) - usage ("isletter (s)"); + print_usage (); endif retval = isalpha (s);
--- a/scripts/strings/lower.m +++ b/scripts/strings/lower.m @@ -29,7 +29,7 @@ function retval = lower (s) if (nargin != 1) - usage ("lower (s)"); + print_usage (); endif if (ischar (s))
--- a/scripts/strings/rindex.m +++ b/scripts/strings/rindex.m @@ -38,7 +38,7 @@ ## This is patterned after the AWK function of the same name. if (nargin != 2) - usage ("rindex (s, t)"); + print_usage (); endif if (!ischar (s) || !ischar (t) || all (size (s) > 1) || all (size (t) > 1) )
--- a/scripts/strings/split.m +++ b/scripts/strings/split.m @@ -95,7 +95,7 @@ error ("split: both s and t must be strings"); endif else - usage ("split (s, t, n)"); + print_usage (); endif endfunction
--- a/scripts/strings/str2mat.m +++ b/scripts/strings/str2mat.m @@ -34,7 +34,7 @@ function retval = str2mat (varargin) if (nargin == 0) - usage ("str2mat (s1, ...)"); + print_usage (); endif nc = 0;
--- a/scripts/strings/str2num.m +++ b/scripts/strings/str2num.m @@ -36,7 +36,7 @@ m = []; endif else - usage ("str2num (s)"); + print_usage (); endif endfunction
--- a/scripts/strings/strcat.m +++ b/scripts/strings/strcat.m @@ -52,7 +52,7 @@ endif endwhile else - usage ("strcat (s, t, ...)"); + print_usage (); endif st = tmpst;
--- a/scripts/strings/strcmpi.m +++ b/scripts/strings/strcmpi.m @@ -48,7 +48,7 @@ retval = false; endif else - usage ("strcmpi (s1, s2)"); + print_usage (); endif endfunction
--- a/scripts/strings/strfind.m +++ b/scripts/strings/strfind.m @@ -36,7 +36,7 @@ function idx = strfind (text, pattern) if (nargin != 2) - usage ("idx = strfind (text, pattern)"); + print_usage (); elseif (! ischar (pattern)) error ("strfind: pattern must be a string value"); endif
--- a/scripts/strings/strjust.m +++ b/scripts/strings/strjust.m @@ -28,7 +28,7 @@ function x = strjust (x, just) if (nargin < 1 || nargin > 2) - usage ("strjust (s, ['left'|'right'|'center'])"); + print_usage (); endif if (nargin == 1)
--- a/scripts/strings/strmatch.m +++ b/scripts/strings/strmatch.m @@ -33,7 +33,7 @@ function idx = strmatch (s, A, exact) if (nargin < 2 || nargin > 3) - usage ("strmatch (s, A, \"exact\")"); + print_usage (); endif [nr, nc] = size (A);
--- a/scripts/strings/strncmp.m +++ b/scripts/strings/strncmp.m @@ -39,7 +39,7 @@ if (nargin == 3) retval = strcmp (strtrunc (s1, n), strtrunc (s2, n)); else - usage ("strncmp (s1, s2, n)"); + print_usage (); endif endfunction
--- a/scripts/strings/strncmpi.m +++ b/scripts/strings/strncmpi.m @@ -41,7 +41,7 @@ ## handle cell arrays of strings. retval = strcmp (lower (strtrunc (s1, n)), lower (strtrunc (s2, n))); else - usage ("strncmpi (s1, s2, n)"); + print_usage (); endif endfunction
--- a/scripts/strings/strrep.m +++ b/scripts/strings/strrep.m @@ -35,7 +35,7 @@ function t = strrep (s, x, y) if (nargin != 3) - usage ("strrep (s, x, y)"); + print_usage (); endif if (! (ischar (s) && ischar (x) && ischar (y)))
--- a/scripts/strings/strtrunc.m +++ b/scripts/strings/strtrunc.m @@ -29,7 +29,7 @@ function s = strtrunc (s, n) if (nargin != 2) - usage ("strtrunc (s, n)"); + print_usage (); endif if (ischar (s))
--- a/scripts/strings/strvcat.m +++ b/scripts/strings/strvcat.m @@ -38,7 +38,7 @@ function retval = strvcat (varargin) if (nargin == 0) - usage ("strvcat (s1, ...)"); + print_usage (); endif nr = zeros (nargin, 1);
--- a/scripts/strings/substr.m +++ b/scripts/strings/substr.m @@ -45,7 +45,7 @@ function t = substr (s, offset, len) if (nargin < 2 || nargin > 3) - usage ("substr (s, offset, len)"); + print_usage (); endif if (ischar (s))
--- a/scripts/strings/upper.m +++ b/scripts/strings/upper.m @@ -29,7 +29,7 @@ function retval = upper (s) if (nargin != 1) - usage ("upper (s)"); + print_usage (); endif if (ischar (s))
--- a/scripts/testfun/assert.m +++ b/scripts/testfun/assert.m @@ -49,7 +49,7 @@ function assert(cond, expected, tol) if (nargin < 1 || nargin > 3) - usage("assert (cond) or assert (v, expected_v [,tol])"); + print_usage (); endif if (nargin < 3)
--- a/scripts/testfun/demo.m +++ b/scripts/testfun/demo.m @@ -78,7 +78,7 @@ function demo(name, n) if (nargin < 1 || nargin > 2) - usage("demo('name') or demo('name, n)"); + print_usage (); endif if (nargin < 2)
--- a/scripts/testfun/example.m +++ b/scripts/testfun/example.m @@ -36,7 +36,7 @@ function [code_r, idx_r] = example(name, n) if (nargin < 1 || nargin > 2) - usage("example('name') or example('name', n)"); + print_usage (); endif if (nargin < 2) n = 0;
--- a/scripts/testfun/fail.m +++ b/scripts/testfun/fail.m @@ -31,7 +31,7 @@ ## PKG_ADD mark_as_command fail function ret=fail(code,pattern,warning_pattern) if nargin < 1 || nargin > 3 - usage("fail(code [, 'warning'] [, pattern])"); + print_usage (); endif ## sort out arguments
--- a/scripts/testfun/speed.m +++ b/scripts/testfun/speed.m @@ -144,7 +144,7 @@ function [__order, __test_n, __tnew, __torig] ... = speed (__f1, __init, __max_n, __f2, __tol) if nargin < 1 || nargin > 6, - usage("speed_test(f, init, max_n, f2, tol)"); + print_usage (); endif if nargin < 2 || isempty(__init), __init = "x = randn(n, 1);";
--- a/scripts/testfun/test.m +++ b/scripts/testfun/test.m @@ -89,10 +89,10 @@ endif if (nargin < 1 || nargin > 3 ... || (!ischar(__name) && !isempty(__name)) || !ischar(__flag)) - usage("success = test('name', ['quiet'|'normal'|'verbose'], fid)"); + print_usage (); endif if (isempty(__name) && (nargin != 3 || !strcmp(__flag, "explain"))) - usage("test([], 'explain', fid)"); + print_usage (); endif __batch = (!isempty(__fid));
--- a/scripts/time/asctime.m +++ b/scripts/time/asctime.m @@ -39,7 +39,7 @@ if (nargin == 1) retval = strftime ("%a %b %d %H:%M:%S %Y\n", t); else - usage ("asctime (TMSTRUCT)"); + print_usage (); endif endfunction
--- a/scripts/time/calendar.m +++ b/scripts/time/calendar.m @@ -58,7 +58,7 @@ m = varargin{2}; d = []; otherwise - usage ("calendar () or c = calendar (d) or c = calendar (y, m)"); + print_usage (); endswitch c = zeros (7, 6);
--- a/scripts/time/ctime.m +++ b/scripts/time/ctime.m @@ -39,7 +39,7 @@ if (nargin == 1) retval = asctime (localtime (t)); else - usage ("ctime (TIME)"); + print_usage (); endif endfunction
--- a/scripts/time/datenum.m +++ b/scripts/time/datenum.m @@ -67,7 +67,7 @@ persistent monthstart = [306; 337; 0; 31; 61; 92; 122; 153; 184; 214; 245; 275]; if (nargin == 0 || (nargin > 2 && ischar (Y)) || nargin > 6) - usage ("n = datenum ('date' [, P]) or n = datenum (Y, M, D [, h, m [, s]])"); + print_usage (); endif if (ischar (Y)) if (nargin < 2)
--- a/scripts/time/datestr.m +++ b/scripts/time/datestr.m @@ -184,7 +184,7 @@ endif if (nargin < 1 || nargin > 3) - usage("str = datestr (date, [f, [p]])"); + print_usage (); endif if (nargin < 2)
--- a/scripts/time/datevec.m +++ b/scripts/time/datevec.m @@ -80,7 +80,7 @@ endif if (nargin < 1 || nargin > 3) - usage("v = datevec (...) or [y, m, d, h, mi, s] = datevec (...)"); + print_usage (); endif switch (nargin)
--- a/scripts/time/eomday.m +++ b/scripts/time/eomday.m @@ -30,7 +30,7 @@ function e = eomday (y, m) if (nargin != 2) - usage ("e = eomday (y, m)"); + print_usage (); endif eom = [31, 28, 31, 30 ,31, 30, 31, 31, 30, 31, 30, 31];