Mercurial > hg > octave-avbm
changeset 14552:86854d032a37
maint: miscellaneous style fixes for .m files
* audio/mu2lin.m, deprecated/cut.m, general/cplxpair.m,
general/genvarname.m, geometry/rectint.m, help/gen_doc_cache.m,
image/hsv2rgb.m, image/rainbow.m, io/textscan.m,
miscellaneous/bzip2.m, miscellaneous/compare_versions.m,
miscellaneous/fact.m, miscellaneous/menu.m, optimization/fminbnd.m,
optimization/fminunc.m, optimization/fzero.m, optimization/sqp.m,
plot/__gnuplot_drawnow__.m, plot/axis.m, plot/findobj.m,
plot/legend.m, plot/peaks.m, plot/private/__errplot__.m,
plot/private/__fltk_print__.m, plot/private/__go_draw_axes__.m,
plot/private/__patch__.m, polynomial/pchip.m, polynomial/residue.m,
signal/periodogram.m, sparse/sprandsym.m, statistics/base/moment.m,
statistics/distributions/expcdf.m, statistics/distributions/expinv.m,
statistics/distributions/exppdf.m, statistics/tests/prop_test_2.m,
statistics/tests/sign_test.m, statistics/tests/t_test.m,
statistics/tests/t_test_2.m, statistics/tests/t_test_regression.m,
strings/regexptranslate.m, time/datetick.m:
Style fixes.
line wrap: on
line diff
--- a/scripts/audio/mu2lin.m +++ b/scripts/audio/mu2lin.m @@ -41,21 +41,21 @@ print_usage (); endif - ulaw = [32124, 31100, 30076, 29052, 28028, 27004, 25980, 24956, \ - 23932, 22908, 21884, 20860, 19836, 18812, 17788, 16764, \ - 15996, 15484, 14972, 14460, 13948, 13436, 12924, 12412, \ - 11900, 11388, 10876, 10364, 9852, 9340, 8828, 8316, \ - 7932, 7676, 7420, 7164, 6908, 6652, 6396, 6140, \ - 5884, 5628, 5372, 5116, 4860, 4604, 4348, 4092, \ - 3900, 3772, 3644, 3516, 3388, 3260, 3132, 3004, \ - 2876, 2748, 2620, 2492, 2364, 2236, 2108, 1980, \ - 1884, 1820, 1756, 1692, 1628, 1564, 1500, 1436, \ - 1372, 1308, 1244, 1180, 1116, 1052, 988, 924, \ - 876, 844, 812, 780, 748, 716, 684, 652, \ - 620, 588, 556, 524, 492, 460, 428, 396, \ - 372, 356, 340, 324, 308, 292, 276, 260, \ - 244, 228, 212, 196, 180, 164, 148, 132, \ - 120, 112, 104, 96, 88, 80, 72, 64, \ + ulaw = [32124, 31100, 30076, 29052, 28028, 27004, 25980, 24956, ... + 23932, 22908, 21884, 20860, 19836, 18812, 17788, 16764, ... + 15996, 15484, 14972, 14460, 13948, 13436, 12924, 12412, ... + 11900, 11388, 10876, 10364, 9852, 9340, 8828, 8316, ... + 7932, 7676, 7420, 7164, 6908, 6652, 6396, 6140, ... + 5884, 5628, 5372, 5116, 4860, 4604, 4348, 4092, ... + 3900, 3772, 3644, 3516, 3388, 3260, 3132, 3004, ... + 2876, 2748, 2620, 2492, 2364, 2236, 2108, 1980, ... + 1884, 1820, 1756, 1692, 1628, 1564, 1500, 1436, ... + 1372, 1308, 1244, 1180, 1116, 1052, 988, 924, ... + 876, 844, 812, 780, 748, 716, 684, 652, ... + 620, 588, 556, 524, 492, 460, 428, 396, ... + 372, 356, 340, 324, 308, 292, 276, 260, ... + 244, 228, 212, 196, 180, 164, 148, 132, ... + 120, 112, 104, 96, 88, 80, 72, 64, ... 56, 48, 40, 32, 24, 16, 8, 0 ]; ulaw = [ -ulaw, ulaw ];
--- a/scripts/deprecated/cut.m +++ b/scripts/deprecated/cut.m @@ -51,10 +51,10 @@ if (!isvector (x)) error ("cut: X must be a vector"); endif - if isscalar (breaks) + if (isscalar (breaks)) breaks = linspace (min (x), max (x), breaks + 1); breaks(1) = breaks(1) - 1; - elseif isvector (breaks) + elseif (isvector (breaks)) breaks = sort (breaks); else error ("cut: BREAKS must be a scalar or vector"); @@ -62,7 +62,7 @@ group = NaN (size (x)); m = length (breaks); - if any (k = find ((x >= min (breaks)) & (x < max (breaks)))) + if (any (k = find ((x >= min (breaks)) & (x < max (breaks))))) n = length (k); group(k) = sum ((ones (m, 1) * reshape (x(k), 1, n)) >= (reshape (breaks, m, 1) * ones (1, n)));
--- a/scripts/general/cplxpair.m +++ b/scripts/general/cplxpair.m @@ -52,7 +52,7 @@ function y = cplxpair (z, tol, dim) - if nargin < 1 || nargin > 3 + if (nargin < 1 || nargin > 3) print_usage (); endif
--- a/scripts/general/genvarname.m +++ b/scripts/general/genvarname.m @@ -158,7 +158,7 @@ endif varname(i) = str(i); idx = 0; - while excluded + while (excluded) idx++; varname{i} = sprintf("%s%d", str{i}, idx); excluded = any (strcmp (varname{i}, exclusions)); @@ -166,7 +166,7 @@ exclusions(end+1) = varname(i); endfor - if strinput + if (strinput) varname = varname{1}; endif
--- a/scripts/geometry/rectint.m +++ b/scripts/geometry/rectint.m @@ -43,7 +43,7 @@ error ("rectint: A must have 4 columns"); elseif (columns (b) != 4) error ("rectint: B must have 4 columns"); - elseif any ([a(:,3:4);b(:,3:4)](:) < 0) + elseif (any ([a(:,3:4);b(:,3:4)](:) < 0)) error ("rectint: all widths and heights must be > 0"); endif @@ -105,7 +105,7 @@ endfor - if swapinputs + if (swapinputs) area = area'; endif
--- a/scripts/help/gen_doc_cache.m +++ b/scripts/help/gen_doc_cache.m @@ -34,7 +34,7 @@ function gen_doc_cache (out_file = "doc-cache", directory = []) ## Check input - if (!ischar (out_file)) + if (! ischar (out_file)) print_usage (); endif @@ -42,11 +42,11 @@ if (isempty (directory)) cache = gen_builtin_cache (); elseif (iscell (directory)) - if all(cellfun (@ischar, directory)) + if (all (cellfun (@ischar, directory))) cache = gen_doc_cache_in_dir (directory); else error ("gen_doc_cache: cell must contain only strings"); - end + endif elseif (ischar (directory)) cache = gen_doc_cache_in_dir (directory); else @@ -120,15 +120,15 @@ dir_in_path = ismember (directory, strsplit (path (), pathsep ())); # dirs not in path - if !iscell (directory) + if (! iscell (directory)) directory = {directory}; - end + endif dirs_notpath = {directory{!dir_in_path}}; # add them - if !isempty (dirs_notpath) + if (! isempty (dirs_notpath)) cellfun (@addpath, dirs_notpath); - end + endif # create cache func = @(s_) create_cache (__list_functions__ (s_)); @@ -138,9 +138,9 @@ cache = [cache{:}]; #remove dirs form path - if !isempty (dirs_notpath) + if (! isempty (dirs_notpath)) cellfun (@rmpath, dirs_notpath); - end + endif endfunction
--- a/scripts/image/hsv2rgb.m +++ b/scripts/image/hsv2rgb.m @@ -59,7 +59,7 @@ endif ## set values <0 to 0 and >1 to 1 - hsv_map = (hsv_map >= 0 & hsv_map <= 1) .* hsv_map \ + hsv_map = (hsv_map >= 0 & hsv_map <= 1) .* hsv_map ... + (hsv_map < 0) .* 0 + (hsv_map > 1); ## fill rgb map with v*(1-s)
--- a/scripts/image/rainbow.m +++ b/scripts/image/rainbow.m @@ -48,16 +48,15 @@ elseif (n > 1) x = linspace (0, 1, n)'; - r = (x < 2/5) \ - + (x >= 2/5 & x < 3/5) .* (-5 * x + 3) \ - + (x >= 4/5) .* (10/3 * x - 8/3); + r = ((x < 2/5) + + (x >= 2/5 & x < 3/5) .* (-5 * x + 3) + + (x >= 4/5) .* (10/3 * x - 8/3)); - g = (x < 2/5) .* (5/2 * x) \ - + (x >= 2/5 & x < 3/5) \ - + (x >= 3/5 & x < 4/5) .* (-5 * x + 4); + g = ((x < 2/5) .* (5/2 * x) + + (x >= 2/5 & x < 3/5) + + (x >= 3/5 & x < 4/5) .* (-5 * x + 4)); - b = (x >= 3/5 & x < 4/5) .* (5 * x - 3) \ - + (x >= 4/5); + b = (x >= 3/5 & x < 4/5) .* (5 * x - 3) + (x >= 4/5); map = [r, g, b]; else
--- a/scripts/io/textscan.m +++ b/scripts/io/textscan.m @@ -234,10 +234,10 @@ ## Start at rightmost column and work backwards to avoid ptr mixup ii = numel (C); - while ii > 1 + while (ii > 1) clss1 = class (C{ii}); jj = ii; - while (jj > 1 && strcmp (clss1, class (C{jj - 1}))) + while (jj > 1 && strcmp (clss1, class (C{jj - 1}))) ## Column to the left is still same class; check next column to the left --jj; endwhile
--- a/scripts/miscellaneous/bzip2.m +++ b/scripts/miscellaneous/bzip2.m @@ -31,7 +31,7 @@ function entries = bzip2 (varargin) if (nargin == 1 || nargin == 2) - if nargout == 0 + if (nargout == 0) __xzip__ ("bzip2", "bz2", "bzip2 %s", varargin{:}); else entries = __xzip__ ("bzip2", "bz2", "bzip2 %s", varargin{:});
--- a/scripts/miscellaneous/compare_versions.m +++ b/scripts/miscellaneous/compare_versions.m @@ -141,22 +141,22 @@ endif ## Determine the operator. - if any (ismember (operator, "=")) + if (any (ismember (operator, "="))) equal_op = true; else equal_op = false; endif - if any (ismember (operator, "~!")) + if (any (ismember (operator, "~!"))) not_op = true; else not_op = false; endif - if any (ismember (operator, "<")) + if (any (ismember (operator, "<"))) lt_op = true; else lt_op = false; endif - if any (ismember (operator, ">")) + if (any (ismember (operator, ">"))) gt_op = true; else gt_op = false;
--- a/scripts/miscellaneous/fact.m +++ b/scripts/miscellaneous/fact.m @@ -24,8 +24,8 @@ ## @end deftypefn -function f = fact() - persistent wisdom = \ +function f = fact () + persistent wisdom = ... { "Richard Stallman takes notes in binary."; "Richard Stallman doesn't need sudo. I will make him a sandwich anyway."; @@ -240,7 +240,7 @@ }; w = wisdom{randi([1, numel(wisdom)])}; - if nargout > 0 + if (nargout > 0) f = w; else w = wordwrap (w); @@ -254,14 +254,15 @@ out = "\n"; i = 1; numwords = numel (wc); - while i <= numwords; + while (i <= numwords); line = wc{i}; - while (i < numwords && length (newline = cstrcat (line, " ", wc{i+1})) < cols) + while (i < numwords + && length (newline = cstrcat (line, " ", wc{i+1})) < cols) line = newline; i++; endwhile out = cstrcat (out, line, "\n"); i++; endwhile - out = cstrcat(out, "\n"); + out = cstrcat (out, "\n"); endfunction \ No newline at end of file
--- a/scripts/miscellaneous/menu.m +++ b/scripts/miscellaneous/menu.m @@ -51,7 +51,7 @@ varargin = varargin{1}; nopt = length (varargin); for i = 1:nopt - while iscell (varargin{i}) + while (iscell (varargin{i})) varargin{i} = varargin{i}{1}; endwhile endfor
--- a/scripts/optimization/fminbnd.m +++ b/scripts/optimization/fminbnd.m @@ -56,8 +56,8 @@ ## Get default options if requested. if (nargin == 1 && ischar (fun) && strcmp (fun, 'defaults')) - x = optimset ("MaxIter", Inf, "MaxFunEvals", Inf, "TolX", 1e-8, \ - "OutputFcn", [], "FunValCheck", "off"); + x = optimset ("MaxIter", Inf, "MaxFunEvals", Inf, "TolX", 1e-8, + "OutputFcn", [], "FunValCheck", "off"); return; endif
--- a/scripts/optimization/fminunc.m +++ b/scripts/optimization/fminunc.m @@ -84,11 +84,11 @@ ## Get default options if requested. if (nargin == 1 && ischar (fcn) && strcmp (fcn, 'defaults')) - x = optimset ("MaxIter", 400, "MaxFunEvals", Inf, \ - "GradObj", "off", "TolX", 1e-7, "TolFun", 1e-7, - "OutputFcn", [], "FunValCheck", "off", - "FinDiffType", "central", - "TypicalX", [], "AutoScaling", "off"); + x = optimset ("MaxIter", 400, "MaxFunEvals", Inf, + "GradObj", "off", "TolX", 1e-7, "TolFun", 1e-7, + "OutputFcn", [], "FunValCheck", "off", + "FinDiffType", "central", + "TypicalX", [], "AutoScaling", "off"); return; endif
--- a/scripts/optimization/fzero.m +++ b/scripts/optimization/fzero.m @@ -100,8 +100,8 @@ ## Get default options if requested. if (nargin == 1 && ischar (fun) && strcmp (fun, 'defaults')) - x = optimset ("MaxIter", Inf, "MaxFunEvals", Inf, "TolX", 1e-8, \ - "OutputFcn", [], "FunValCheck", "off"); + x = optimset ("MaxIter", Inf, "MaxFunEvals", Inf, "TolX", 1e-8, + "OutputFcn", [], "FunValCheck", "off"); return; endif
--- a/scripts/optimization/sqp.m +++ b/scripts/optimization/sqp.m @@ -697,8 +697,8 @@ if (isempty (__sqp_cifcn__)) res = [x(lbidx,1)-__sqp_lb__; __sqp_ub__-x(ubidx,1)]; else - res = [feval(__sqp_cifcn__,x); \ - x(lbidx,1)-__sqp_lb__; __sqp_ub__-x(ubidx,1)]; + res = [feval(__sqp_cifcn__,x); x(lbidx,1)-__sqp_lb__; + __sqp_ub__-x(ubidx,1)]; endif endfunction
--- a/scripts/plot/__gnuplot_drawnow__.m +++ b/scripts/plot/__gnuplot_drawnow__.m @@ -259,9 +259,9 @@ size_str = ""; endif else - if isempty (h) + if (isempty (h)) disp ("gnuplot_set_term: figure handle is empty"); - elseif !isfigure(h) + elseif (! isfigure (h)) disp ("gnuplot_set_term: not a figure handle"); endif title_str = "";
--- a/scripts/plot/axis.m +++ b/scripts/plot/axis.m @@ -180,7 +180,7 @@ __do_tight_option__ (ca); elseif (strcmpi (ax, "square")) set (ca, "plotboxaspectratio", [1, 1, 1]); - elseif (strcmp (ax, "equal")) + elseif (strcmp (ax, "equal")) if (strcmp (get (get (ca, "parent"), "__graphics_toolkit__"), "gnuplot")) ## FIXME - gnuplot applies the aspect ratio activepostionproperty. set (ca, "activepositionproperty", "position"); @@ -321,7 +321,7 @@ scale = get (ca, strcat (ax, "scale")); if (! iscell (data)) data = {data}; - end + endif if (strcmp (scale, "log")) tmp = data; data = cellfun (@(x) x(x>0), tmp, "uniformoutput", false); @@ -346,7 +346,7 @@ set (ca, "xlim", __get_tight_lims__ (ca, "x"), "ylim", __get_tight_lims__ (ca, "y")); - if __calc_dimensions__ (ca) > 2 + if (__calc_dimensions__ (ca) > 2) set (ca, "zlim", __get_tight_lims__ (ca, "z")); endif
--- a/scripts/plot/findobj.m +++ b/scripts/plot/findobj.m @@ -148,16 +148,16 @@ na = na + 1; if (na <= numel(args)) if (ischar (args{na})) - if strcmpi(args{na}, "-and") + if (strcmpi (args{na}, "-and")) logicaloperator{np} = "and"; na = na+1; - elseif strcmpi(args{na}, "-or") + elseif (strcmpi (args{na}, "-or")) logicaloperator{np} = "or"; na = na+1; - elseif strcmpi(args{na}, "-xor") + elseif (strcmpi (args{na}, "-xor")) logicaloperator{np} = "xor"; na = na+1; - elseif strcmpi(args{na}, "-not") + elseif (strcmpi (args{na}, "-not")) logicaloperator{np} = "not"; na = na+1; endif @@ -173,7 +173,7 @@ endif else ## This is sloppy ... but works like Matlab. - if strcmpi(args{na}, "-not") + if (strcmpi (args{na}, "-not")) h = []; return endif @@ -213,7 +213,7 @@ else if (regularexpression(np)) match = regexp (p.(pname{np}), pvalue{np}); - if isempty (match) + if (isempty (match)) match = 0; endif elseif (numel (p.(pname{np})) == numel (pvalue{np}))
--- a/scripts/plot/legend.m +++ b/scripts/plot/legend.m @@ -304,7 +304,7 @@ hax = getfield (get (hlegend, "userdata"), "handle"); [hplots, text_strings] = __getlegenddata__ (hlegend); - if (strcmp (position, "default")) + if (strcmp (position, "default")) h = legend (hax, hplots, text_strings, "orientation", orientation); elseif (strcmp (orientation, "default")) if (outside)
--- a/scripts/plot/peaks.m +++ b/scripts/plot/peaks.m @@ -55,7 +55,7 @@ if (nargin == 0) x = y = linspace (-3, 3, 49); elseif (nargin == 1) - if length(x) > 1 + if (length (x) > 1) y = x; else x = y = linspace (-3, 3, x); @@ -69,8 +69,8 @@ Y = y; endif - Z = 3 * (1 - X) .^ 2 .* exp(- X .^ 2 - (Y + 1) .^ 2) \ - - 10 * (X / 5 - X .^ 3 - Y .^ 5) .* exp(- X .^ 2 - Y .^ 2) \ + Z = 3 * (1 - X) .^ 2 .* exp(- X .^ 2 - (Y + 1) .^ 2) ... + - 10 * (X / 5 - X .^ 3 - Y .^ 5) .* exp(- X .^ 2 - Y .^ 2) ... - 1 / 3 * exp(- (X + 1) .^ 2 - Y .^ 2); if (nargout == 0)
--- a/scripts/plot/private/__errplot__.m +++ b/scripts/plot/private/__errplot__.m @@ -219,7 +219,7 @@ tlgnd(end+1) = fmt.key; legend (gca(), hlgnd, tlgnd); - end + endif endfunction
--- a/scripts/plot/private/__fltk_print__.m +++ b/scripts/plot/private/__fltk_print__.m @@ -153,7 +153,7 @@ vw = get (haxes, "view"); if (iscell (vw)) vw = vertcat (vw{:}); - end + endif is2D = all (abs (vw(:,2)) == 90); if (is2D) gl2ps_device{end} = [gl2ps_device{end}, "is2D"];
--- a/scripts/plot/private/__go_draw_axes__.m +++ b/scripts/plot/private/__go_draw_axes__.m @@ -2322,7 +2322,7 @@ if (! isempty (n1)) n1 = n1 + 1; n2 = setdiff (n2, n1); - end + endif for n = numel(n2):-1:1 labels{m} = [labels{m}(1:n2(n)-1), "\\", labels{m}(n2(n):end)]; endfor
--- a/scripts/plot/private/__patch__.m +++ b/scripts/plot/private/__patch__.m @@ -326,7 +326,7 @@ if (nr == 1 && nc > 1) nr = nc; nc = 1; - end + endif if (!isempty (z)) vert = [x(:), y(:), z(:)]; else
--- a/scripts/polynomial/pchip.m +++ b/scripts/polynomial/pchip.m @@ -79,7 +79,7 @@ if (isvector (y)) y = y(:).'; ##row vector szy = size (y); - if !(size_equal (x, y)) + if (! size_equal (x, y)) error ("pchip: length of X and Y must match") endif else @@ -96,7 +96,7 @@ h = diff (x); y = fliplr (y); elseif (any (h <= 0)) - error("pchip: X must be strictly monotonic"); + error ("pchip: X must be strictly monotonic"); endif f1 = y(:, 1:n-1);
--- a/scripts/polynomial/residue.m +++ b/scripts/polynomial/residue.m @@ -285,7 +285,7 @@ k = []; endif - if numel (e) + if (numel (e)) indx = 1:numel(p); else [e, indx] = mpoles (p, toler, 0); @@ -297,7 +297,7 @@ for n = indx pn = [1, -p(n)]; - if n == 1 + if (n == 1) pden = pn; else pden = conv (pden, pn);
--- a/scripts/signal/periodogram.m +++ b/scripts/signal/periodogram.m @@ -122,7 +122,7 @@ if (strcmp (range, "onesided")) range = 1; - elseif strcmp (range, "twosided") + elseif (strcmp (range, "twosided")) range = 2; else range = 2-isreal (x);
--- a/scripts/sparse/sprandsym.m +++ b/scripts/sparse/sprandsym.m @@ -119,7 +119,7 @@ ## numerically to avoid overflow. ## Degenerate case - if k == 1 + if (k == 1) r = 1; return endif
--- a/scripts/statistics/base/moment.m +++ b/scripts/statistics/base/moment.m @@ -165,7 +165,7 @@ if (any (type == "c")) x = center (x, dim); endif - if any (type == "a") + if (any (type == "a")) x = abs (x); endif
--- a/scripts/statistics/distributions/expcdf.m +++ b/scripts/statistics/distributions/expcdf.m @@ -59,10 +59,10 @@ cdf(k) = 1; k = (x > 0) & (x < Inf) & (lambda > 0); - if isscalar (lambda) - cdf(k) = 1 - exp (- x(k) / lambda); + if (isscalar (lambda)) + cdf(k) = 1 - exp (-x(k) / lambda); else - cdf(k) = 1 - exp (- x(k) ./ lambda(k)); + cdf(k) = 1 - exp (-x(k) ./ lambda(k)); endif endfunction
--- a/scripts/statistics/distributions/expinv.m +++ b/scripts/statistics/distributions/expinv.m @@ -63,7 +63,7 @@ inv(k) = Inf; k = (x >= 0) & (x < 1) & (lambda > 0); - if isscalar (lambda) + if (isscalar (lambda)) inv(k) = - lambda * log (1 - x(k)); else inv(k) = - lambda(k) .* log (1 - x(k));
--- a/scripts/statistics/distributions/exppdf.m +++ b/scripts/statistics/distributions/exppdf.m @@ -53,10 +53,10 @@ pdf(k) = NaN; k = (x >= 0) & (x < Inf) & (lambda > 0); - if isscalar (lambda) - pdf(k) = exp (- x(k) / lambda) / lambda; + if (isscalar (lambda)) + pdf(k) = exp (-x(k) / lambda) / lambda; else - pdf(k) = exp (- x(k) ./ lambda(k)) ./ lambda(k); + pdf(k) = exp (-x(k) ./ lambda(k)) ./ lambda(k); endif endfunction
--- a/scripts/statistics/tests/prop_test_2.m +++ b/scripts/statistics/tests/prop_test_2.m @@ -65,9 +65,9 @@ endif if (strcmp (alt, "!=") || strcmp (alt, "<>")) pval = 2 * min (cdf, 1 - cdf); - elseif strcmp (alt, ">") + elseif (strcmp (alt, ">")) pval = 1 - cdf; - elseif strcmp (alt, "<") + elseif (strcmp (alt, "<")) pval = cdf; else error ("prop_test_2: option %s not recognized", alt);
--- a/scripts/statistics/tests/sign_test.m +++ b/scripts/statistics/tests/sign_test.m @@ -68,9 +68,9 @@ endif if (strcmp (alt, "!=") || strcmp (alt, "<>")) pval = 2 * min (cdf, 1 - cdf); - elseif strcmp (alt, ">") + elseif (strcmp (alt, ">")) pval = 1 - cdf; - elseif strcmp (alt, "<") + elseif (strcmp (alt, "<")) pval = cdf; else error ("sign_test: option %s not recognized", alt);
--- a/scripts/statistics/tests/t_test.m +++ b/scripts/statistics/tests/t_test.m @@ -68,9 +68,9 @@ endif if (strcmp (alt, "!=") || strcmp (alt, "<>")) pval = 2 * min (cdf, 1 - cdf); - elseif strcmp (alt, ">") + elseif (strcmp (alt, ">")) pval = 1 - cdf; - elseif strcmp (alt, "<") + elseif (strcmp (alt, "<")) pval = cdf; else error ("t_test: option %s not recognized", alt);
--- a/scripts/statistics/tests/t_test_2.m +++ b/scripts/statistics/tests/t_test_2.m @@ -69,9 +69,9 @@ endif if (strcmp (alt, "!=") || strcmp (alt, "<>")) pval = 2 * min (cdf, 1 - cdf); - elseif strcmp (alt, ">") + elseif (strcmp (alt, ">")) pval = 1 - cdf; - elseif strcmp (alt, "<") + elseif (strcmp (alt, "<")) pval = cdf; else error ("t_test_2: option %s not recognized", alt);
--- a/scripts/statistics/tests/t_test_regression.m +++ b/scripts/statistics/tests/t_test_regression.m @@ -81,9 +81,9 @@ if (strcmp (alt, "!=") || strcmp (alt, "<>")) pval = 2 * min (cdf, 1 - cdf); - elseif strcmp (alt, ">") + elseif (strcmp (alt, ">")) pval = 1 - cdf; - elseif strcmp (alt, "<") + elseif (strcmp (alt, "<")) pval = cdf; else error ("t_test_regression: the value `%s' for alt is not possible", alt);
--- a/scripts/strings/regexptranslate.m +++ b/scripts/strings/regexptranslate.m @@ -53,7 +53,7 @@ function y = regexptranslate (op, s) - if nargin != 2 + if (nargin != 2) print_usage (); endif
--- a/scripts/time/datetick.m +++ b/scripts/time/datetick.m @@ -199,22 +199,22 @@ endif if (isempty (form)) - r = max(ticks) - min(ticks); - if r < 10/60/24 + r = max (ticks) - min (ticks); + if (r < 10/60/24) ## minutes and seconds form = 13; - elseif r < 2 + elseif (r < 2) ## hours form = 15; - elseif r < 15 + elseif (r < 15) ## days form = 8; - elseif r < 365 + elseif (r < 365) ## FIXME -- FORM should be 19 for European users who use dd/mm ## instead of mm/dd. How can that be determined automatically? ## months form = 6; - elseif r < 90*12 + elseif (r < 90*12) ## quarters form = 27; else