# HG changeset patch # User Rik # Date 1342557259 25200 # Node ID c2dbdeaa25df8767ae2561e5fe1d4ec510f2ed06 # Parent 26c4ca9782b06b23fa11ec0bdcfc9f435475e089 maint: use rows() and columns() to clarify m-files. * gradient.m, interp1q.m, rat.m, tsearchn.m, image.m, imwrite.m, area.m, contourc.m, hist.m, isocolors.m, isonormals.m, meshz.m, print.m, __bar__.m, __go_draw_axes__.m, __interp_cube__.m, __marching_cube__.m, __patch__.m, __print_parse_opts__.m, __quiver__.m, rose.m, shrinkfaces.m, stairs.m, surfnorm.m, tetramesh.m, text.m, deconv.m, spline.m, intersect.m, setdiff.m, setxor.m, union.m, periodogram.m, pcg.m, perms.m: Replace size (x,1) with rows (x) and size(x,2) with columns(x). diff --git a/scripts/general/gradient.m b/scripts/general/gradient.m --- a/scripts/general/gradient.m +++ b/scripts/general/gradient.m @@ -87,7 +87,7 @@ transposed = false; if (isvector (m)) ## make a row vector. - transposed = (size (m, 2) == 1); + transposed = (columns (m) == 1); m = m(:).'; endif diff --git a/scripts/general/interp1q.m b/scripts/general/interp1q.m --- a/scripts/general/interp1q.m +++ b/scripts/general/interp1q.m @@ -37,7 +37,7 @@ function yi = interp1q (x, y, xi) x = x(:); - nx = size (x, 1); + nx = rows (x); szy = size (y); y = y(:,:); [ny, nc] = size (y); diff --git a/scripts/general/rat.m b/scripts/general/rat.m --- a/scripts/general/rat.m +++ b/scripts/general/rat.m @@ -116,7 +116,7 @@ d = reshape (d, size (x)); else n = ""; - nsteps = size (steps, 2); + nsteps = columns (steps); for i = 1: nsz s = [int2str(y(i))," "]; j = 1; diff --git a/scripts/geometry/tsearchn.m b/scripts/geometry/tsearchn.m --- a/scripts/geometry/tsearchn.m +++ b/scripts/geometry/tsearchn.m @@ -31,9 +31,9 @@ print_usage (); endif - nt = size (t, 1); + nt = rows (t); [m, n] = size (x); - mi = size (xi, 1); + mi = rows (xi); idx = NaN (mi, 1); p = NaN (mi, n + 1); diff --git a/scripts/image/image.m b/scripts/image/image.m --- a/scripts/image/image.m +++ b/scripts/image/image.m @@ -135,12 +135,12 @@ if (xdata(2) < xdata(1)) xdata = xdata(2:-1:1); elseif (xdata(2) == xdata(1)) - xdata = xdata(1) + [0, size(img,2)-1]; + xdata = xdata(1) + [0, columns(img)-1]; endif if (ydata(2) < ydata(1)) ydata = ydata(2:-1:1); elseif (ydata(2) == ydata(1)) - ydata = ydata(1) + [0, size(img,1)-1]; + ydata = ydata(1) + [0, rows(img)-1]; endif xlim = xdata + [-px(1), px(1)]; ylim = ydata + [-px(2), px(2)]; diff --git a/scripts/image/imwrite.m b/scripts/image/imwrite.m --- a/scripts/image/imwrite.m +++ b/scripts/image/imwrite.m @@ -162,7 +162,7 @@ error ("imwrite: %s: invalid class for indexed image data", img_class); endif if (isa (map, "double")) - if (ndims (map) != 2 || size (map, 2) != 3) + if (ndims (map) != 2 || columns (map) != 3) error ("imwrite: invalid size for colormap"); endif else diff --git a/scripts/plot/area.m b/scripts/plot/area.m --- a/scripts/plot/area.m +++ b/scripts/plot/area.m @@ -80,7 +80,7 @@ y = y(:); endif if (isempty (x)) - x = repmat ([1:size(y, 1)]', 1, columns (y)); + x = repmat ([1:rows(y)]', 1, columns (y)); elseif (isvector (x)) x = repmat (x(:), 1, columns (y)); endif @@ -107,7 +107,7 @@ y0 = bv * ones (1, rows (y)); y0 = zeros (1, rows (y)); retval = []; - for i = 1: size (y, 2); + for i = 1: columns (y); hg = hggroup (); retval = [retval; hg]; args = __add_datasource__ ("area", hg, {"x", "y"}, varargin{:}); diff --git a/scripts/plot/contourc.m b/scripts/plot/contourc.m --- a/scripts/plot/contourc.m +++ b/scripts/plot/contourc.m @@ -101,8 +101,8 @@ c = __contourc__ (x(:)', y(:)', z, vv); else ## Indexes x,y for the purpose of __contourc__. - ii = 1:size (z,2); - jj = 1:size (z,1); + ii = 1:columns (z); + jj = 1:rows (z); ## Now call __contourc__ for the real work... c = __contourc__ (ii, jj, z, vv); @@ -111,7 +111,7 @@ ## to the original grid (x,y) i = 1; - while (i < size (c,2)) + while (i < columns (c)) clen = c(2, i); ind = i + [1 : clen]; @@ -123,8 +123,8 @@ ## return NA for those values. ## The permitted range is enforced here: - ci = max (ci, 1); ci = min (ci, size (z, 2)); - cj = max (cj, 1); cj = min (cj, size (z, 1)); + ci = max (ci, 1); ci = min (ci, columns (z)); + cj = max (cj, 1); cj = min (cj, rows (z)); c(1, ind) = interp2 (ii, jj, x, ci, cj); c(2, ind) = interp2 (ii, jj, y, ci, cj); diff --git a/scripts/plot/hist.m b/scripts/plot/hist.m --- a/scripts/plot/hist.m +++ b/scripts/plot/hist.m @@ -160,7 +160,7 @@ nn = freq; xx = x; endif - elseif (size (freq, 2) != 1) + elseif (columns (freq) != 1) bar (x, freq, 0.8, varargin{iarg:end}); else bar (x, freq, 1.0, varargin{iarg:end}); diff --git a/scripts/plot/isocolors.m b/scripts/plot/isocolors.m --- a/scripts/plot/isocolors.m +++ b/scripts/plot/isocolors.m @@ -134,7 +134,7 @@ otherwise print_usage (); endswitch - if (ismatrix (vp) && size (vp,2) == 3) + if (ismatrix (vp) && columns (vp) == 3) pa = []; v = vp; elseif ( ishandle (vp) ) @@ -144,7 +144,7 @@ error ("isocolors: last argument is not a vertex list or patch handle"); endif if (calc_rgb) - new_col = zeros (size (v, 1), 3); + new_col = zeros (rows (v), 3); new_col(:,1) = __interp_cube__ (x, y, z, R, v, "values" ); new_col(:,2) = __interp_cube__ (x, y, z, G, v, "values" ); new_col(:,3) = __interp_cube__ (x, y, z, B, v, "values" ); diff --git a/scripts/plot/isonormals.m b/scripts/plot/isonormals.m --- a/scripts/plot/isonormals.m +++ b/scripts/plot/isonormals.m @@ -122,7 +122,7 @@ otherwise print_usage (); endswitch - if (ismatrix (vp) && size (vp,2) == 3) + if (ismatrix (vp) && columns (vp) == 3) pa = []; v = vp; elseif (ishandle (vp)) diff --git a/scripts/plot/meshz.m b/scripts/plot/meshz.m --- a/scripts/plot/meshz.m +++ b/scripts/plot/meshz.m @@ -69,9 +69,9 @@ endif zref = min (z(isfinite (z))); - z = [zref .* ones(1, size(z, 2) + 2); - zref .* ones(size(z, 1), 1), z, zref .* ones(size(z, 1), 1); - zref.* ones(1, size(z, 2) + 2)]; + z = [zref .* ones(1, columns(z) + 2); + zref .* ones(rows(z), 1), z, zref .* ones(rows(z), 1); + zref.* ones(1, columns(z) + 2)]; oldh = gca (); unwind_protect diff --git a/scripts/plot/print.m b/scripts/plot/print.m --- a/scripts/plot/print.m +++ b/scripts/plot/print.m @@ -364,7 +364,7 @@ props(end).value = {get(h(n), color_props{c})}; if (isnumeric (rgb)) ## convert RGB color to RGB gray scale - xfer = repmat ([0.30, 0.59, 0.11], size (rgb, 1), 1); + xfer = repmat ([0.30, 0.59, 0.11], rows (rgb), 1); ggg = repmat (sum (xfer .* rgb, 2), 1, 3); set (h(n), color_props{c}, ggg); endif diff --git a/scripts/plot/private/__bar__.m b/scripts/plot/private/__bar__.m --- a/scripts/plot/private/__bar__.m +++ b/scripts/plot/private/__bar__.m @@ -45,12 +45,12 @@ if (isvector (y)) y = y(:); endif - if (size (x, 1) != size (y, 1)) + if (rows (x) != rows (y)) y = varargin{1}; if (isvector (y)) y = y(:); endif - x = [1:size(y,1)]'; + x = [1:rows(y)]'; idx = 2; else if (! isvector (x)) @@ -63,7 +63,7 @@ if (isvector (y)) y = y(:); endif - x = [1:size(y,1)]'; + x = [1:rows(y)]'; idx = 2; endif @@ -105,8 +105,8 @@ endif endwhile - xlen = size (x, 1); - ylen = size (y, 1); + xlen = rows (x); + ylen = rows (y); if (xlen != ylen) error ("%s: length of x and y must be equal", func); @@ -115,7 +115,7 @@ error ("%s: x vector values must be in ascending order", func); endif - ycols = size (y, 2); + ycols = columns (y); if (numel (x) > 1) cutoff = min (diff (double (x))) / 2; else diff --git a/scripts/plot/private/__go_draw_axes__.m b/scripts/plot/private/__go_draw_axes__.m --- a/scripts/plot/private/__go_draw_axes__.m +++ b/scripts/plot/private/__go_draw_axes__.m @@ -495,13 +495,13 @@ img_xdata = img_xdata(2:-1:1); img_data = img_data(:,end:-1:1,:); elseif (img_xdata(1) == img_xdata(2)) - img_xdata = img_xdata(1) + [0, size(img_data,2)-1]; + img_xdata = img_xdata(1) + [0, columns(img_data)-1]; endif if (img_ydata(2) < img_ydata(1)) img_ydata = img_ydata(2:-1:1); img_data = img_data(end:-1:1,:,:); elseif (img_ydata(1) == img_ydata(2)) - img_ydata = img_ydata(1) + [0, size(img_data,1)-1]; + img_ydata = img_ydata(1) + [0, rows(img_data)-1]; endif [y_dim, x_dim] = size (img_data(:,:,1)); @@ -680,14 +680,14 @@ || strncmp (obj.facecolor, "interp", 6)) && isfield (obj, "cdata")) if (ndims (obj.cdata) == 2 - && (size (obj.cdata, 2) == nc - && (size (obj.cdata, 1) == 1 - || size (obj.cdata, 1) == 3))) + && (columns (obj.cdata) == nc + && (rows (obj.cdata) == 1 + || rows (obj.cdata) == 3))) ccol = cdat (:, i); elseif (ndims (obj.cdata) == 2 - && (size (obj.cdata, 1) == nc - && (size (obj.cdata, 2) == 1 - || size (obj.cdata, 2) == 3))) + && (rows (obj.cdata) == nc + && (columns (obj.cdata) == 1 + || columns (obj.cdata) == 3))) ccol = cdat (i, :); elseif (ndims (obj.cdata) == 3) ccol = permute (cdat (:, i, :), [1, 3, 2]); @@ -704,10 +704,10 @@ if (cdatadirect) r = round (ccol); else - r = 1 + round ((size (cmap, 1) - 1) + r = 1 + round ((rows (cmap) - 1) * (ccol - clim(1))/(clim(2) - clim(1))); endif - r = max (1, min (r, size (cmap, 1))); + r = max (1, min (r, rows (cmap))); color = cmap(r, :); endif elseif (strncmp (obj.facecolor, "interp", 6)) @@ -728,10 +728,10 @@ if (cdatadirect) r = round (ccol); else - r = 1 + round ((size (cmap, 1) - 1) + r = 1 + round ((rows (cmap) - 1) * (ccol - clim(1))/(clim(2) - clim(1))); endif - r = max (1, min (r, size (cmap, 1))); + r = max (1, min (r, rows (cmap))); color = cmap(r(1),:); endif endif @@ -812,14 +812,14 @@ || strncmp (ec, "interp", 6)) && isfield (obj, "cdata")) if (ndims (obj.cdata) == 2 - && (size (obj.cdata, 2) == nc - && (size (obj.cdata, 1) == 1 - || size (obj.cdata, 1) == 3))) + && (columns (obj.cdata) == nc + && (rows (obj.cdata) == 1 + || rows (obj.cdata) == 3))) ccol = cdat (:, i); elseif (ndims (obj.cdata) == 2 - && (size (obj.cdata, 1) == nc - && (size (obj.cdata, 2) == 1 - || size (obj.cdata, 2) == 3))) + && (rows (obj.cdata) == nc + && (columns (obj.cdata) == 1 + || columns (obj.cdata) == 3))) ccol = cdat (i, :); elseif (ndims (obj.cdata) == 3) ccol = permute (cdat (:, i, :), [1, 3, 2]); @@ -1315,7 +1315,7 @@ endif if (ischar (obj.string)) - num_lines = size (obj.string, 1); + num_lines = rows (obj.string); else num_lines = numel (obj.string); endif @@ -1730,9 +1730,9 @@ endfunction function x = flip (x) - if (size (x, 1) == 1) + if (rows (x) == 1) x = fliplr (x); - elseif (size (x, 2) == 1 || ischar (x)) + elseif (columns (x) == 1 || ischar (x)) x = flipud (x); else x = flipud (fliplr (x)); @@ -2206,7 +2206,7 @@ ticklabel = num2str (ticklabel(:), 5); endif if (ischar (ticklabel)) - if (size (ticklabel, 1) == 1 && any (ticklabel == "|")) + if (rows (ticklabel) == 1 && any (ticklabel == "|")) ticklabel = strsplit (ticklabel, "|"); else ticklabel = cellstr (ticklabel); @@ -2276,7 +2276,7 @@ ## The text object maybe multiline, and may be of any class str = getfield (obj, fld); - if (ischar (str) && size (str, 1) > 1) + if (ischar (str) && rows (str) > 1) str = cellstr (str); elseif (isnumeric (str)) str = cellstr (num2str (str(:))); diff --git a/scripts/plot/private/__interp_cube__.m b/scripts/plot/private/__interp_cube__.m --- a/scripts/plot/private/__interp_cube__.m +++ b/scripts/plot/private/__interp_cube__.m @@ -39,7 +39,7 @@ if (size (val) != [length(x), length(y), length(z)]) error ("__interp_cube__: VAL has wrong dimensions"); endif - if (size (v, 2) != 3) + if (columns (v) != 3) error ( "v has to be N*3 matrix"); endif if (!ischar (req)) diff --git a/scripts/plot/private/__marching_cube__.m b/scripts/plot/private/__marching_cube__.m --- a/scripts/plot/private/__marching_cube__.m +++ b/scripts/plot/private/__marching_cube__.m @@ -169,13 +169,13 @@ if (calc_cols) pp(id__, 1:5, jj) = [vertex_interp(iso, xx(id1), yy(id1), zz(id1), ... xx(id2), yy(id2), zz(id2), c(id1), c(id2), colors(id1), colors(id2)), ... - (1:size (id_, 1))' + ix_offset ]; + (1:rows (id_))' + ix_offset ]; else pp(id__, 1:4, jj) = [vertex_interp(iso, xx(id1), yy(id1), zz(id1), ... xx(id2), yy(id2), zz(id2), c(id1), c(id2)), ... - (1:size (id_, 1))' + ix_offset ]; + (1:rows (id_))' + ix_offset ]; endif - ix_offset += size (id_, 1); + ix_offset += rows (id_); endfor ## phase III: calculate the triangulation from the point list @@ -183,7 +183,7 @@ tri = tri_table(cc(id)+1, :); for jj=1:3:15 id_ = find (tri(:, jj)>0); - p = [id_, lindex*ones(size (id_, 1), 1),tri(id_, jj:jj+2)]; + p = [id_, lindex*ones(rows (id_), 1),tri(id_, jj:jj+2)]; if (!isempty (p)) p1 = sub2ind (size (pp), p(:,1), p(:,2), p(:,3)); p2 = sub2ind (size (pp), p(:,1), p(:,2), p(:,4)); diff --git a/scripts/plot/private/__patch__.m b/scripts/plot/private/__patch__.m --- a/scripts/plot/private/__patch__.m +++ b/scripts/plot/private/__patch__.m @@ -97,7 +97,7 @@ if (isnumeric (c)) if (isvector (c) && numel (c) == numel (x)) c = c(:); - elseif (size (c, 1) != numel (x) && size (c, 2) == numel (x)) + elseif (rows (c) != numel (x) && columns (c) == numel (x)) c = c.'; endif endif @@ -111,7 +111,7 @@ if (isnumeric (c)) - if (ndims (c) == 3 && size (c, 2) == 1) + if (ndims (c) == 3 && columns (c) == 1) c = permute (c, [1, 3, 2]); endif @@ -136,14 +136,14 @@ args{10} = []; elseif (ndims (c) == 3 && size (c, 3) == 3) ## CDATA is specified as RGB data - if ((size (c, 1) == 1 && size (c, 2) == 1) ... - || (size (c, 1) == 1 && size (c, 2) == columns (x))) + if ((rows (c) == 1 && columns (c) == 1) ... + || (rows (c) == 1 && columns (c) == columns (x))) ## Single patch color or per-face color args{7} = "facecolor"; args{8} = "flat"; args{9} = "cdata"; args{10} = c; - elseif (size (c, 1) == rows (x) && size (c, 2) == columns (x)) + elseif (rows (c) == rows (x) && columns (c) == columns (x)) ## Per-vertex color args{7} = "facecolor"; args{8} = "interp"; @@ -252,7 +252,7 @@ args = {"facecolor", fc, args{:}}; endif - nc = size (faces, 1); + nc = rows (faces); idx = faces .'; t1 = isnan (idx); for i = find (any (t1)) @@ -276,7 +276,7 @@ reshape (fvc(idx, 3), size (idx))); elseif (isempty (fvc)) c = []; - else ## if (size (fvc, 2) == 1) + else ## if (columnns (fvc) == 1) c = permute (fvc(faces), [2, 1]); endif endif @@ -336,7 +336,7 @@ faces = faces'; if (ndims (c) == 3) - fvc = reshape (c, size (c, 1) * size (c, 2), size (c, 3)); + fvc = reshape (c, rows (c) * columns (c), size (c, 3)); else fvc = c(:); endif diff --git a/scripts/plot/private/__print_parse_opts__.m b/scripts/plot/private/__print_parse_opts__.m --- a/scripts/plot/private/__print_parse_opts__.m +++ b/scripts/plot/private/__print_parse_opts__.m @@ -569,7 +569,7 @@ ## Papersize is tall when portrait,and wide when landscape. if ((papersize(1) > papersize(2) && strcmpi (paperorientation, "portrait")) || (papersize(1) < papersize(2) && strcmpi (paperorientation, "landscape"))) - papersize = papersize ([2,1]); + papersize = papersize([2,1]); paperposition = paperposition([2,1,4,3]); endif diff --git a/scripts/plot/private/__quiver__.m b/scripts/plot/private/__quiver__.m --- a/scripts/plot/private/__quiver__.m +++ b/scripts/plot/private/__quiver__.m @@ -43,9 +43,9 @@ v = varargin{ioff++}; if (is3d) w = varargin{ioff++}; - [x, y, z] = meshgrid (1:size (u,2), 1:size (u,1), 1:max (size (w))); + [x, y, z] = meshgrid (1:columns (u), 1:rows (u), 1:max (size (w))); else - [x, y] = meshgrid (1:size (u,2), 1:size (u,1)); + [x, y] = meshgrid (1:columns (u), 1:rows (u)); endif if (nargin >= ioff && isnumeric (varargin{ioff}) && isscalar (varargin{ioff})) diff --git a/scripts/plot/rose.m b/scripts/plot/rose.m --- a/scripts/plot/rose.m +++ b/scripts/plot/rose.m @@ -80,7 +80,7 @@ x1 = xx(1:end-1) + diff (xx, 1) / 2; x1 = [x1 ; x1; x1; x1](:); th = [0; 0; x1; 2*pi ; 2*pi]; - r = zeros (4 * size (nn, 1), size (nn, 2)); + r = zeros (4 * rows (nn), columns (nn)); r(2:4:end, :) = nn; r(3:4:end, :) = nn; diff --git a/scripts/plot/shrinkfaces.m b/scripts/plot/shrinkfaces.m --- a/scripts/plot/shrinkfaces.m +++ b/scripts/plot/shrinkfaces.m @@ -104,26 +104,26 @@ error ("shrinkfaces: scale factor must be a positive scalar") endif - n = size (vertices, 2); + n = columns (vertices); if (n < 2 || n > 3) error ("shrinkfaces: only 2D and 3D patches are supported") endif - m = size (faces, 2); + m = columns (faces); if (m < 3) error ("shrinkfaces: faces must consist of at least 3 vertices") endif v = vertices(faces'(:), :); - if (isempty (colors) || size (colors, 1) == size (faces, 1)) + if (isempty (colors) || rows (colors) == rows (faces)) c = colors; - elseif (size (colors, 1) == size (vertices, 1)) + elseif (rows (colors) == rows (vertices)) c = colors(faces'(:), :); else ## Discard inconsistent color data. c = []; endif - sv = size (v, 1); + sv = rows (v); ## we have to deal with a probably very large number of vertices, so ## use sparse we use as midpoint (1/m, ..., 1/m) in generalized ## barycentric coordinates. diff --git a/scripts/plot/stairs.m b/scripts/plot/stairs.m --- a/scripts/plot/stairs.m +++ b/scripts/plot/stairs.m @@ -156,7 +156,7 @@ h = []; unwind_protect hold_state = get (gca (), "nextplot"); - for i = 1 : size(y, 2) + for i = 1 : columns (y) hg = hggroup (); h = [h; hg]; args = __add_datasource__ ("stairs", hg, {"x", "y"}, varargin{:}); diff --git a/scripts/plot/surfnorm.m b/scripts/plot/surfnorm.m --- a/scripts/plot/surfnorm.m +++ b/scripts/plot/surfnorm.m @@ -27,8 +27,8 @@ ## ## @example ## @group -## [@var{x}, @var{y}] = meshgrid (1:size (@var{z}, 1), -## 1:size (@var{z}, 2)); +## [@var{x}, @var{y}] = meshgrid (1:rows (@var{z}), +## 1:columns (@var{z})); ## @end group ## @end example ## diff --git a/scripts/plot/tetramesh.m b/scripts/plot/tetramesh.m --- a/scripts/plot/tetramesh.m +++ b/scripts/plot/tetramesh.m @@ -70,7 +70,7 @@ colmap = colormap (); if (length (reg) < 3) - size_colmap = size (colmap, 1); + size_colmap = rows (colmap); C = mod ((1:size_T)' - 1, size_colmap) + 1; if (size_T < size_colmap && size_T > 1) ## expand to the available range of colors diff --git a/scripts/plot/text.m b/scripts/plot/text.m --- a/scripts/plot/text.m +++ b/scripts/plot/text.m @@ -57,7 +57,7 @@ ny = numel (y); nz = numel (z); if (ischar (label) || isnumeric (label)) - nt = size (label, 1); + nt = rows (label); if (nx > 1 && nt == 1) ## Mutiple text objects with same string label = repmat ({label}, [nx, 1]); diff --git a/scripts/polynomial/deconv.m b/scripts/polynomial/deconv.m --- a/scripts/polynomial/deconv.m +++ b/scripts/polynomial/deconv.m @@ -68,7 +68,7 @@ r = y - conv (a, b); else ## Respect the orientation of Y" - if (size (y, 1) <= size (y, 2)) + if (rows (y) <= columns (y)) r = [(zeros (1, lc - ly)), y] - conv (a, b); else r = [(zeros (lc - ly, 1)); y] - conv (a, b); diff --git a/scripts/polynomial/spline.m b/scripts/polynomial/spline.m --- a/scripts/polynomial/spline.m +++ b/scripts/polynomial/spline.m @@ -100,7 +100,7 @@ endfor complete = false; - if (size (a, 1) == n + 2) + if (rows (a) == n + 2) complete = true; dfs = a(1,:); dfe = a(end,:); diff --git a/scripts/set/intersect.m b/scripts/set/intersect.m --- a/scripts/set/intersect.m +++ b/scripts/set/intersect.m @@ -75,7 +75,7 @@ ib = jb(ic(ii+1) - len_a); ## b(ib) == c endif - if (nargin == 2 && (size (b, 1) == 1 || size (a, 1) == 1)) + if (nargin == 2 && (rows (b) == 1 || rows (a) == 1)) c = c.'; endif endif diff --git a/scripts/set/setdiff.m b/scripts/set/setdiff.m --- a/scripts/set/setdiff.m +++ b/scripts/set/setdiff.m @@ -82,7 +82,7 @@ i(idx(dups)) = []; endif ## Reshape if necessary. - if (size (c, 1) != 1 && size (b, 1) == 1) + if (rows (c) != 1 && rows (b) == 1) c = c.'; endif endif diff --git a/scripts/set/setxor.m b/scripts/set/setxor.m --- a/scripts/set/setxor.m +++ b/scripts/set/setxor.m @@ -79,7 +79,7 @@ c([idx, idx+1]) = []; i([idx, idx+1]) = []; endif - if (size (a, 1) == 1 || size (b, 1) == 1) + if (rows (a) == 1 || rows (b) == 1) c = c.'; endif endif diff --git a/scripts/set/union.m b/scripts/set/union.m --- a/scripts/set/union.m +++ b/scripts/set/union.m @@ -65,7 +65,7 @@ if (nargin == 2) y = [a(:); b(:)]; na = numel (a); nb = numel (b); - if (size (a, 1) == 1 || size (b, 1) == 1) + if (rows (a) == 1 || rows (b) == 1) y = y.'; endif else diff --git a/scripts/signal/periodogram.m b/scripts/signal/periodogram.m --- a/scripts/signal/periodogram.m +++ b/scripts/signal/periodogram.m @@ -108,7 +108,7 @@ if (! isempty (window)) if (all (size (x) == size (window))) x .*= window; - elseif (size (x, 1) == size (window, 1) && size (window, 2) == 1) + elseif (rows (x) == rows (window) && columns (window) == 1) x .*= window (:,ones (1,c)); endif; endif diff --git a/scripts/sparse/pcg.m b/scripts/sparse/pcg.m --- a/scripts/sparse/pcg.m +++ b/scripts/sparse/pcg.m @@ -241,7 +241,7 @@ endif if (nargin < 4 || isempty (maxit)) - maxit = min (size (b, 1), 20); + maxit = min (rows (b), 20); endif maxit += 2; diff --git a/scripts/specfun/perms.m b/scripts/specfun/perms.m --- a/scripts/specfun/perms.m +++ b/scripts/specfun/perms.m @@ -52,7 +52,7 @@ for j = 2:n B = A; A = zeros (prod (2:j), n, class (v)); - k = size (B, 1); + k = rows (B); idx = 1:k; for i = j:-1:1 A(idx,1:i-1) = B(:,1:i-1);