Mercurial > hg > octave-terminal
changeset 7208:a730e47fda4d
[project @ 2007-11-28 02:32:41 by jwe]
line wrap: on
line diff
--- a/scripts/general/diff.m +++ b/scripts/general/diff.m @@ -98,13 +98,13 @@ n = sz (dim); idx1 = cell (); for i = 1:nd - idx1 {i} = 1:sz(i); + idx1{i} = 1:sz(i); endfor idx2 = idx1; for i = 1 : k; - idx1 {dim} = 2 : (n - i + 1); - idx2 {dim} = 1 : (n - i); - x = x (idx1 {:}) - x (idx2 {:}); + idx1{dim} = 2 : (n - i + 1); + idx2{dim} = 1 : (n - i); + x = x(idx1{:}) - x(idx2{:}); endfor endif else @@ -113,17 +113,17 @@ else idx1 = cell (); for i = 1:nd - idx1 {i} = 1:sz(i); + idx1{i} = 1:sz(i); endfor idx2 = idx1; while (k) n = sz (dim); for i = 1 : min (k, n - 1) - idx1 {dim} = 2 : (n - i + 1); - idx2 {dim} = 1 : (n - i); - x = x (idx1 {:}) - x (idx2 {:}); + idx1{dim} = 2 : (n - i + 1); + idx2{dim} = 1 : (n - i); + x = x(idx1{:}) - x(idx2{:}); endfor - idx1 {dim} = idx2 {dim} = 1; + idx1{dim} = idx2{dim} = 1; k = k - min (k, n - 1); dim = dim + 1; endwhile
--- a/scripts/general/int2str.m +++ b/scripts/general/int2str.m @@ -37,7 +37,7 @@ if (nc > 1) idx = cell (); for i = 1:nd - idx {i} = 1:sz(i); + idx{i} = 1:sz(i); endfor idx(2) = 1; ifmt = get_fmt (x(idx{:}), 0);
--- a/scripts/general/interpn.m +++ b/scripts/general/interpn.m @@ -71,22 +71,22 @@ print_usage (); endif - if (ischar (varargin {end})) - method = varargin {end}; + if (ischar (varargin{end})) + method = varargin{end}; nargs = nargs - 1; - elseif (ischar (varargin {end - 1})) - if (! isnumeric (varargin {end}) || ! isscalar (varargin {end})) + elseif (ischar (varargin{end - 1})) + if (! isnumeric (varargin{end}) || ! isscalar (varargin{end})) error ("extrapal is expected to be a numeric scalar"); endif - method = varargin {end - 1}; + method = varargin{end - 1}; nargs = nargs - 2; endif if (nargs < 3) - v = varargin {1}; + v = varargin{1}; m = 1; if (nargs == 2) - m = varargin {2}; + m = varargin{2}; if (! isnumeric (m) || ! isscalar (m) || floor (m) != m) error ("m is expected to be a integer scalar"); endif @@ -99,8 +99,8 @@ x{i} = 1 : sz(i); y{i} = 1 : (1 / (2 ^ m)) : sz(i); endfor - elseif (! isvector (varargin {1}) && nargs == (ndims (varargin {1}) + 1)) - v = varargin {1}; + elseif (! isvector (varargin{1}) && nargs == (ndims (varargin{1}) + 1)) + v = varargin{1}; sz = size (v); nd = ndims (v); x = cell (1, nd); @@ -109,9 +109,9 @@ x{i} = 1 : sz(i); endfor elseif (rem (nargs, 2) == 1 && nargs == - (2 * ndims (varargin {ceil (nargs / 2)})) + 1) + (2 * ndims (varargin{ceil (nargs / 2)})) + 1) nv = ceil (nargs / 2); - v = varargin {nv}; + v = varargin{nv}; sz = size (v); nd = ndims (v); x = varargin (1 : (nv - 1)); @@ -159,8 +159,7 @@ endfor idx = cell (1,nd); for i = 1 : nd - idx {i} = yidx{i} + (y{i} - x{i}(yidx{i}).' > ... - x{i}(yidx{i} + 1).' - y{i}); + idx{i} = yidx{i} + (y{i} - x{i}(yidx{i}).' > x{i}(yidx{i} + 1).' - y{i}); endfor vi = v (sub2ind (sz, idx{:})); idx = zeros (prod(yshape),1);
--- a/scripts/general/num2str.m +++ b/scripts/general/num2str.m @@ -82,10 +82,10 @@ perm(2:2:2*nc) = perm(2:2:2*nc) + nc; idx = cell (); for i = 1:nd - idx {i} = 1:sz(i); + idx{i} = 1:sz(i); endfor idx{2} = perm; - x = horzcat (real(x), imag(x)); + x = horzcat (real (x), imag (x)); x = x(idx{:}); fmt = strcat (deblank (repmat (fmt, 1, nc)), "\n");
--- a/scripts/general/postpad.m +++ b/scripts/general/postpad.m @@ -70,10 +70,10 @@ if (d >= l) idx = cell (); for i = 1:nd - idx {i} = 1:sz(i); + idx{i} = 1:sz(i); endfor - idx {dim} = 1:l; - y = x (idx {:}); + idx{dim} = 1:l; + y = x(idx{:}); else sz (dim) = l - d; y = cat (dim, x, c * ones (sz));
--- a/scripts/general/prepad.m +++ b/scripts/general/prepad.m @@ -83,10 +83,10 @@ if (d >= l) idx = cell (); for i = 1:nd - idx {i} = 1:sz(i); + idx{i} = 1:sz(i); endfor - idx {dim} = d-l+1:d; - y = x (idx {:}); + idx{dim} = d-l+1:d; + y = x(idx{:}); else sz (dim) = l - d; y = cat (dim, c * ones (sz), x);
--- a/scripts/general/shift.m +++ b/scripts/general/shift.m @@ -69,16 +69,16 @@ idx = cell (); for i = 1:nd - idx {i} = 1:sz(i); + idx{i} = 1:sz(i); endfor if (b >= 0) b = rem (b, d); - idx {dim} = [d-b+1:d, 1:d-b]; + idx{dim} = [d-b+1:d, 1:d-b]; elseif (b < 0) b = rem (abs (b), d); - idx {dim} = [b+1:d, 1:b]; + idx{dim} = [b+1:d, 1:b]; endif - y = x (idx {:}); + y = x(idx{:}); endfunction
--- a/scripts/general/structfun.m +++ b/scripts/general/structfun.m @@ -68,7 +68,7 @@ endif varargout = cell (max ([nargout, 1]), 1); - [varargout{:}] = cellfun (fun, struct2cell (s), varargin {:}); + [varargout{:}] = cellfun (fun, struct2cell (s), varargin{:}); if (iscell (varargout{1})) [varargout{:}] = cell2struct (varargout{1}, fieldnames(s), 1);
--- a/scripts/geometry/delaunayn.m +++ b/scripts/geometry/delaunayn.m @@ -52,7 +52,7 @@ print_usage (); endif - t = __delaunayn__ (x, varargin {:}); + t = __delaunayn__ (x, varargin{:}); ## Try to remove the zero volume simplices. The volume of the i-th simplex is ## given by abs(det(x(t(i,1:end-1),:)-x(t(i,2:end),:)))/prod(1:n)
--- a/scripts/geometry/voronoi.m +++ b/scripts/geometry/voronoi.m @@ -136,7 +136,7 @@ edges = zeros (2, k); for i = 1 : ll - fac = c {idx(i)}; + fac = c{idx(i)}; lf = length (fac); fac = [fac, fac(1)]; fst = fac (1 : length(fac) - 1);
--- a/scripts/image/image.m +++ b/scripts/image/image.m @@ -46,7 +46,7 @@ elseif (nargin == 1) print_usage (); elseif (isscalar (varargin{1}) && ishandle (varargin{1})) - h = varargin {1}; + h = varargin{1}; if (! strcmp (get (h, "type"), "axes")) error ("image: expecting first argument to be an axes object"); endif
--- a/scripts/image/imagesc.m +++ b/scripts/image/imagesc.m @@ -45,7 +45,7 @@ if (nargin < 1) print_usage (); elseif (isscalar (varargin{1}) && ishandle (varargin{1})) - h = varargin {1}; + h = varargin{1}; if (! strcmp (get (h, "type"), "axes")) error ("imagesc: expecting first argument to be an axes object"); endif
--- a/scripts/miscellaneous/what.m +++ b/scripts/miscellaneous/what.m @@ -67,15 +67,15 @@ ## Ignore mdl and p files [dummy, f, e] = fileparts (n); if (strcmp (e, ".m")) - w.m {end+1} = n; + w.m{end+1} = n; elseif (strcmp (e, mexext ())) - w.mex {end + 1} = n; + w.mex{end+1} = n; elseif (strcmp (e, ".oct")) - w.oct {end + 1} = n; + w.oct{end+1} = n; elseif (strcmp (e, ".mat")) - w.mat {end + 1} = n; + w.mat{end+1} = n; elseif(strcmp (n(1), "@")) - w.classes {end + 1} = n; + w.classes{end+1} = n; endif endif endfor
--- a/scripts/pkg/pkg.m +++ b/scripts/pkg/pkg.m @@ -1856,24 +1856,24 @@ dirs = {}; desc = {}; for i = 1:length (files) - idx = strcmp (pnames, files {i}); + idx = strcmp (pnames, files{i}); if (! any (idx)) error ("package %s is not installed", files{i}); endif - dirs {end + 1} = pdirs {idx}; - desc {end + 1} = installed_pkgs_lst {idx}; + dirs{end+1} = pdirs{idx}; + desc{end+1} = installed_pkgs_lst{idx}; endfor endif ## Check for architecture dependent directories archdirs = {}; for i = 1:length (dirs) - tmpdir = getarchdir (desc {i}); + tmpdir = getarchdir (desc{i}); if (exist (tmpdir, "dir")) - archdirs{end + 1} = dirs{i}; - archdirs{end + 1} = tmpdir; + archdirs{end+1} = dirs{i}; + archdirs{end+1} = tmpdir; else - archdirs{end+ 1} = dirs {i}; + archdirs{end+1} = dirs{i}; endif endfor @@ -1997,7 +1997,7 @@ for k = 1 : length (deps) for j = 1 : length (desc) if (strcmp (desc{j}.name, deps{k}.package)) - tmpdesc {end + 1} = desc{j}; + tmpdesc{end+1} = desc{j}; break; endif endfor @@ -2005,7 +2005,7 @@ if (! isempty (tmpdesc)) newdesc = {newdesc{:}, save_order(tmpdesc){:}, desc{i}}; else - newdesc {end + 1} = desc{i}; + newdesc{end+1} = desc{i}; endif endif endfor @@ -2028,11 +2028,11 @@ execpath = EXEC_PATH (); for i = idx; ndir = installed_pkgs_lst{i}.dir; - dirs {end + 1} = ndir; + dirs{end+1} = ndir; if (exist (fullfile (dirs{end}, "bin"), "dir")) execpath = strcat (fullfile(dirs{end}, "bin"), ":", execpath); endif - tmpdir = getarchdir (installed_pkgs_lst {i}); + tmpdir = getarchdir (installed_pkgs_lst{i}); if (exist (tmpdir, "dir")) dirs{end + 1} = tmpdir; if (exist (fullfile (dirs{end}, "bin"), "dir")) @@ -2087,7 +2087,7 @@ dep = false; for i = 1 : length (archdepsuffix) - ext = archdepsuffix {i}; + ext = archdepsuffix{i}; if (ext(end) == "*") isglob = true; ext(end) = []; @@ -2096,7 +2096,7 @@ endif pos = findstr (nm, ext); if (pos) - if (! isglob && (length(nm) - pos(end) != length(ext) - 1)) + if (! isglob && (length(nm) - pos(end) != length(ext) - 1)) continue; endif dep = true;
--- a/scripts/plot/__axes_limits__.m +++ b/scripts/plot/__axes_limits__.m @@ -23,7 +23,7 @@ fcnmode = sprintf("%smode", fcn); if (nargin > 1 && isscalar (varargin{1}) && ishandle (varargin{1})) - h = varargin {1}; + h = varargin{1}; off = 1; if (! strcmp (get (h, "type"), "axes")) error ("%s: expecting first argument to be an axes object", fcn); @@ -36,7 +36,7 @@ if (nargin == off + 1) retval = get (h, fcn); else - arg = varargin {off + 1}; + arg = varargin{off + 1}; if (ischar (arg)) arg = tolower (arg);
--- a/scripts/plot/__bar__.m +++ b/scripts/plot/__bar__.m @@ -160,7 +160,7 @@ if (nargout < 2) newplot (); tmp = __bars__ (h, vertical, x, y, xb, yb, width, group, - have_line_spec, newargs {:}); + have_line_spec, newargs{:}); if (nargout == 1) varargout{1} = tmp; endif
--- a/scripts/plot/__bars__.m +++ b/scripts/plot/__bars__.m @@ -35,9 +35,9 @@ lev = (i - 1) * (clim(2) - clim(1)) / (ycols - 1) - clim(1); endif tmp = [tmp; patch(xb(:,:,i), yb(:,:,i), "FaceColor", "flat", - "cdata", lev, varargin {:})]; + "cdata", lev, varargin{:})]; else - tmp = [tmp; patch(xb(:,:,i), yb(:,:,i), varargin {:})]; + tmp = [tmp; patch(xb(:,:,i), yb(:,:,i), varargin{:})]; endif endfor else @@ -50,9 +50,9 @@ lev = (i - 1) * (clim(2) - clim(1)) / (ycols - 1) - clim(1); endif tmp = [tmp; patch(yb(:,:,i), xb(:,:,i), "FaceColor", "flat", - "cdata", lev, varargin {:})]; + "cdata", lev, varargin{:})]; else - tmp = [tmp; patch(yb(:,:,i), xb(:,:,i), varargin {:})]; + tmp = [tmp; patch(yb(:,:,i), xb(:,:,i), varargin{:})]; endif endfor endif
--- a/scripts/plot/__contour__.m +++ b/scripts/plot/__contour__.m @@ -20,17 +20,17 @@ function [c, h] = __contour__ (varargin) - ax = varargin {1}; - z = varargin {2}; + ax = varargin{1}; + z = varargin{2}; if (ischar (z)) if (strcmp (z, "none")) z = NaN; elseif (strcmp (z, "base")) if (nargin == 1) - z = varargin {1}; + z = varargin{1}; else - z = varargin {3}; + z = varargin{3}; endif z = 2 * (min (z(:)) - max (z(:))); elseif (! strcmp (z, "level"))
--- a/scripts/plot/__patch__.m +++ b/scripts/plot/__patch__.m @@ -48,7 +48,7 @@ if (nargin > 3 && ndims (varargin{3}) == 2 && ndims (x) == 2 && isequal (size (varargin{3}), size (x))) - z = varargin {3}; + z = varargin{3}; have_z = true; iarg++; endif
--- a/scripts/plot/colorbar.m +++ b/scripts/plot/colorbar.m @@ -67,7 +67,7 @@ pos = "eastoutside"; for i = 1 : length (varargin) - arg = varargin {i}; + arg = varargin{i}; if (length(arg) < 1) pos = "eastoutside"; elseif (ischar (arg))
--- a/scripts/plot/fill.m +++ b/scripts/plot/fill.m @@ -30,7 +30,7 @@ htmp = []; if (isscalar (varargin{1}) && ishandle (varargin{1})) - h = varargin {1}; + h = varargin{1}; if (! strcmp (get (h, "type"), "axes")) error ("fill: expecting first argument to be an axes object"); endif @@ -82,25 +82,25 @@ i = 1; while (i < nargin) iargs (end + 1) = i; - if (ischar (varargin {i}) && (strcmp (tolower (varargin{i}), "faces") || + if (ischar (varargin{i}) && (strcmp (tolower (varargin{i}), "faces") || strcmp (tolower (varargin{i}), "vertices"))) i += 4; - elseif (isnumeric (varargin {i})) + elseif (isnumeric (varargin{i})) i += 2; endif if (i <= nargin) while (true); - if (ischar (varargin {i}) && + if (ischar (varargin{i}) && (strcmp (tolower (varargin{i}), "faces") || strcmp (tolower (varargin{i}), "vertices"))) break; - elseif (isnumeric (varargin {i})) + elseif (isnumeric (varargin{i})) ## Assume its the colorspec i++; break; - elseif (ischar (varargin {i})) - colspec = tolower (varargin {i}); + elseif (ischar (varargin{i})) + colspec = tolower (varargin{i}); collen = length (colspec); if (strncmp (colspec, "blue", collen) ||
--- a/scripts/plot/findobj.m +++ b/scripts/plot/findobj.m @@ -109,7 +109,7 @@ regularexpression(np) = 0; property(np) = 0; logicaloperator{np} = 'and'; - if (ischar (args {na})) + if (ischar (args{na})) if (strcmpi(args{na}, '-regexp')) if (na + 2 <= numel (args)) regularexpression(np) = 1;
--- a/scripts/plot/hist.m +++ b/scripts/plot/hist.m @@ -69,7 +69,7 @@ x = x * (max_val - min_val) + ones(size(x)) * min_val; else ## nargin is either 2 or 3 - x = varargin {iarg++}; + x = varargin{iarg++}; if (isscalar (x)) n = x; if (n <= 0)
--- a/scripts/plot/meshz.m +++ b/scripts/plot/meshz.m @@ -30,7 +30,7 @@ function retval = meshz (varargin) if (isscalar (varargin{1}) && ishandle (varargin{1})) - h = varargin {1}; + h = varargin{1}; if (! strcmp (get (h, "type"), "axes")) error ("meshz: expecting first argument to be an axes object"); endif @@ -55,7 +55,7 @@ ioff = nargin + 1; for i = 1 : nargin - if (ischar (varargin {i})) + if (ischar (varargin{i})) ioff = i; break; endif @@ -67,14 +67,14 @@ endif if (ioff == 2) - z = varargin {1}; + z = varargin{1}; [m, n] = size (z); x = 1 : n; y = (1 : m).'; else - x = varargin {1}; - y = varargin {2}; - z = varargin {3}; + x = varargin{1}; + y = varargin{2}; + z = varargin{3}; endif
--- a/scripts/plot/patch.m +++ b/scripts/plot/patch.m @@ -37,7 +37,7 @@ function h = patch (varargin) if (isscalar (varargin{1}) && ishandle (varargin{1})) - h = varargin {1}; + h = varargin{1}; if (! strcmp (get (h, "type"), "axes") && ! strcmp (get (h, "type"), "hggroup")) error ("patch: expecting first argument to be an axes or hggroup object"); endif
--- a/scripts/plot/pie.m +++ b/scripts/plot/pie.m @@ -47,7 +47,7 @@ if (nargin < 1) print_usage (); elseif (isscalar (varargin{1}) && ishandle (varargin{1})) - h = varargin {1}; + h = varargin{1}; if (! strcmp (get (h, "type"), "axes")) error ("pie: expecting first argument to be an axes object"); endif @@ -140,7 +140,7 @@ endif hlist = [hlist; patch(xoff + [0, - sind(xn)], yoff + [0, cosd(xn)], i); - text(xt, yt, labels {i}, "horizontalalignment", align)]; + text(xt, yt, labels{i}, "horizontalalignment", align)]; endfor if (len == 1)
--- a/scripts/plot/plot.m +++ b/scripts/plot/plot.m @@ -179,7 +179,7 @@ function retval = plot (varargin) if (isscalar (varargin{1}) && ishandle (varargin{1})) - h = varargin {1}; + h = varargin{1}; if (! strcmp (get (h, "type"), "axes")) error ("plot: expecting first argument to be an axes object"); endif
--- a/scripts/plot/plotyy.m +++ b/scripts/plot/plotyy.m @@ -56,7 +56,7 @@ function [Ax, H1, H2] = plotyy (varargin) if (isscalar (varargin{1}) && ishandle (varargin{1})) - ax = varargin {1}; + ax = varargin{1}; if (! strcmp (get (ax, "type"), "axes")) error ("plotyy: expecting first argument to be an axes object"); endif
--- a/scripts/plot/quiver.m +++ b/scripts/plot/quiver.m @@ -61,7 +61,7 @@ if (nargin < 2) print_usage (); elseif (isscalar (varargin{1}) && ishandle (varargin{1})) - h = varargin {1}; + h = varargin{1}; if (! strcmp (get (h, "type"), "axes")) error ("quiver: expecting first argument to be an axes object"); endif
--- a/scripts/plot/quiver3.m +++ b/scripts/plot/quiver3.m @@ -64,7 +64,7 @@ if (nargin < 2) print_usage (); elseif (isscalar (varargin{1}) && ishandle (varargin{1})) - h = varargin {1}; + h = varargin{1}; if (! strcmp (get (h, "type"), "axes")) error ("quiver: expecting first argument to be an axes object"); endif
--- a/scripts/plot/scatter.m +++ b/scripts/plot/scatter.m @@ -59,7 +59,7 @@ if (nargin < 2) print_usage (); elseif (isscalar (varargin{1}) && ishandle (varargin{1})) - h = varargin {1}; + h = varargin{1}; if (! strcmp (get (h, "type"), "axes")) error ("scatter: expecting first argument to be an axes object"); endif
--- a/scripts/plot/scatter3.m +++ b/scripts/plot/scatter3.m @@ -58,7 +58,7 @@ if (nargin < 2) print_usage (); elseif (isscalar (varargin{1}) && ishandle (varargin{1})) - h = varargin {1}; + h = varargin{1}; if (! strcmp (get (h, "type"), "axes")) error ("scatter3: expecting first argument to be an axes object"); endif
--- a/scripts/plot/surface.m +++ b/scripts/plot/surface.m @@ -42,7 +42,7 @@ function h = surface (varargin) if (isscalar (varargin{1}) && ishandle (varargin{1})) - h = varargin {1}; + h = varargin{1}; if (! strcmp (get (h, "type"), "axes")) error ("surface: expecting first argument to be an axes object"); endif @@ -72,7 +72,7 @@ h = 0; firststring = nargin; for i = 2 : nargin - if (ischar (varargin {i - 1})) + if (ischar (varargin{i - 1})) firststring = i - 1; break; endif @@ -123,8 +123,8 @@ error ("surface: x and y must be vectors and z must be a matrix"); endif elseif (firststring == 3) - z = varargin {1}; - c = varargin {2}; + z = varargin{1}; + c = varargin{2}; if (ismatrix (z)) [nr, nc] = size (z); x = 1:nc; @@ -133,7 +133,7 @@ error ("surface: argument must be a matrix"); endif elseif (firststring == 2) - z = varargin {1}; + z = varargin{1}; c = z; if (ismatrix (z)) [nr, nc] = size (z); @@ -151,7 +151,7 @@ h = __go_surface__ (ax, "xdata", x, "ydata", y, "zdata", z, "cdata", c); set (h, "facecolor","flat"); if (firststring < nargin) - set (h, varargin {firststring:end}); + set (h, varargin{firststring:end}); endif if (! ishold ())
--- a/scripts/plot/surfc.m +++ b/scripts/plot/surfc.m @@ -42,9 +42,9 @@ endif if (nargin == 1) - z = varargin {1}; + z = varargin{1}; else - z = varargin {3}; + z = varargin{3}; endif zmin = 2 * (min(z(:)) - max(z(:)));
--- a/scripts/plot/surfnorm.m +++ b/scripts/plot/surfnorm.m @@ -57,7 +57,7 @@ varargout = cell (0, 0); endif if (isscalar (varargin{1}) && ishandle (varargin{1})) - h = varargin {1}; + h = varargin{1}; if (! strcmp (get (h, "type"), "axes")) error ("surfnorm: expecting first argument to be an axes object"); endif
--- a/scripts/plot/xlabel.m +++ b/scripts/plot/xlabel.m @@ -33,7 +33,7 @@ function h = xlabel (varargin) if (isscalar (varargin{1}) && ishandle (varargin{1})) - ax = varargin {1}; + ax = varargin{1}; if (! strcmp (get (ax, "type"), "axes")) error ("xlabel: expecting first argument to be an axes object"); endif
--- a/scripts/plot/xlim.m +++ b/scripts/plot/xlim.m @@ -38,7 +38,7 @@ ## @end deftypefn function retval = xlim (varargin) - ret = __axes_limits__ ("xlim", varargin {:}); + ret = __axes_limits__ ("xlim", varargin{:}); if (! isempty (ret)) retval = ret;
--- a/scripts/plot/ylabel.m +++ b/scripts/plot/ylabel.m @@ -28,7 +28,7 @@ function h = ylabel (varargin) if (isscalar (varargin{1}) && ishandle (varargin{1})) - ax = varargin {1}; + ax = varargin{1}; if (! strcmp (get (ax, "type"), "axes")) error ("ylabel: expecting first argument to be an axes object"); endif
--- a/scripts/plot/ylim.m +++ b/scripts/plot/ylim.m @@ -38,7 +38,7 @@ ## @end deftypefn function retval = ylim (varargin) - ret = __axes_limits__ ("ylim", varargin {:}); + ret = __axes_limits__ ("ylim", varargin{:}); if (! isempty (ret)) retval = ret;
--- a/scripts/plot/zlabel.m +++ b/scripts/plot/zlabel.m @@ -28,7 +28,7 @@ function h = zlabel (varargin) if (isscalar (varargin{1}) && ishandle (varargin{1})) - ax = varargin {1}; + ax = varargin{1}; if (! strcmp (get (ax, "type"), "axes")) error ("zlabel: expecting first argument to be an axes object"); endif
--- a/scripts/plot/zlim.m +++ b/scripts/plot/zlim.m @@ -38,7 +38,7 @@ ## @end deftypefn function retval = zlim (varargin) - ret = __axes_limits__ ("zlim", varargin {:}); + ret = __axes_limits__ ("zlim", varargin{:}); if (! isempty (ret)) retval = ret;
--- a/scripts/signal/fftshift.m +++ b/scripts/signal/fftshift.m @@ -60,9 +60,9 @@ sz2 = ceil (sz(dim) / 2); idx = cell (); for i=1:nd - idx {i} = 1:sz(i); + idx{i} = 1:sz(i); endfor - idx {dim} = [sz2+1:sz(dim), 1:sz2]; + idx{dim} = [sz2+1:sz(dim), 1:sz2]; retval = V (idx{:}); else if (isvector (V))
--- a/scripts/signal/ifftshift.m +++ b/scripts/signal/ifftshift.m @@ -39,7 +39,7 @@ endif if (nargin == 2) - if (!isscalar (dim)) + if (! isscalar (dim)) error ("ifftshift: dimension must be an integer scalar"); endif nd = ndims (V); @@ -47,9 +47,9 @@ sz2 = floor (sz(dim) / 2); idx = cell (); for i=1:nd - idx {i} = 1:sz(i); + idx{i} = 1:sz(i); endfor - idx {dim} = [sz2+1:sz(dim), 1:sz2]; + idx{dim} = [sz2+1:sz(dim), 1:sz2]; retval = V (idx{:}); else if (isvector (V))
--- a/scripts/signal/unwrap.m +++ b/scripts/signal/unwrap.m @@ -46,7 +46,7 @@ else ## Find the first non-singleton dimension dim = 1; - while (dim < nd + 1 && sz (dim) == 1) + while (dim < nd + 1 && sz(dim) == 1) dim = dim + 1; endwhile if (dim > nd) @@ -62,7 +62,7 @@ tol = abs (tol); rng = 2*pi; - m = sz (dim); + m = sz(dim); ## Handle case where we are trying to unwrap a scalar, or only have ## one sample in the specified dimension. @@ -75,10 +75,10 @@ ## as large values, and the sign will show direction. idx = cell (); for i = 1:nd - idx {i} = 1:sz(i); + idx{i} = 1:sz(i); endfor - idx {dim} = [1,1:m-1]; - d = a (idx {:}) - a; + idx{dim} = [1,1:m-1]; + d = a(idx{:}) - a; ## Find only the peaks, and multiply them by the range so that there ## are kronecker deltas at each wrap point multiplied by the range
--- a/scripts/statistics/base/center.m +++ b/scripts/statistics/base/center.m @@ -44,7 +44,7 @@ dim=1; endif; else - dim = varargin {1}; + dim = varargin{1}; endif sz = ones (1, ndims (x)); sz (dim) = size (x, dim);
--- a/scripts/statistics/base/mode.m +++ b/scripts/statistics/base/mode.m @@ -86,7 +86,7 @@ c = cell (sz2); m = zeros (sz2); for i = 1 : prod (sz2) - c {i} = xs (t2 (:, i) == f(i), i); + c{i} = xs (t2 (:, i) == f(i), i); m (i) = c{i}(1); endfor endfunction
--- a/scripts/statistics/base/run_count.m +++ b/scripts/statistics/base/run_count.m @@ -85,7 +85,7 @@ retval(idx{:}) = sum (tmp == k); endfor idx{1} = n; - retval (idx {:}) = sum (tmp >= n); + retval (idx{:}) = sum (tmp >= n); if (dim != 1) retval = ipermute (retval, perm);
--- a/scripts/strings/strvcat.m +++ b/scripts/strings/strvcat.m @@ -43,13 +43,13 @@ nr = zeros (nargin, 1); nc = zeros (nargin, 1); K = 0; - nd = ndims (varargin {1}); - sz = size (varargin {1}); - for k = 1 : nargin + nd = ndims (varargin{1}); + sz = size (varargin{1}); + for k = 1:nargin s = varargin{k}; if (iscell (s)) for k1 = 1:length(s) - K = K+1; + K++; nr(K) = size (s{k1}, 1); nc(K) = size (s{k1}, 2); if (ndims (s{k1}) != nd) @@ -61,7 +61,7 @@ endif endfor else - K = K + 1; + K++; nr(K) = size (s, 1); nc(K) = size (s, 2); if (ndims (s) != nd) @@ -79,13 +79,13 @@ retval = char (ones (sz) * toascii (" ")); idx = cell(nd,1); - for k = 3 : nd; - idx {k} = sz {k}; + for k = 3:nd + idx{k} = sz{k}; endfor K = 0; row_offset = 0; - for k = 1 : nargin + for k = 1:nargin s = varargin{k}; if (iscell (s)) for k1 = 1:length(s) @@ -96,9 +96,9 @@ row_offset = row_offset + size (s{k1}, 1); endfor else - K = K + 1; + K++; if (nc(K) > 0) - retval ((row_offset + 1) : (row_offset + nr(K)), 1:nc(K)) = char(s); + retval ((row_offset+1):(row_offset+nr(K)), 1:nc(K)) = char (s); endif row_offset = row_offset + nr(K); endif