# HG changeset patch # User Rik # Date 1312678998 25200 # Node ID cefd568ea07386d42dd87b4d60bf9024cdcb662e # Parent 7bd29d875af1835f77ae34706c99477bb93f0924 Replace function handles with function names in cellfun calls for 15% speedup. * accumarray.m arrayfun.m, blkdiag.m, cell2mat.m, common_size.m, interp3.m, interpn.m, __isequal__.m, structfun.m, voronoi.m, strread.m, fullfile.m, getfield.m, __xzip__.m, setfield.m, what.m, pkg.m, axis.m, pareto.m, __ghostscript__.m, __go_draw_axes__.m, __patch__.m, refreshdata.m, whitebg.m, lcm.m, index.m, strcat.m, strmatch.m, validatestring.m: Replace function handles in calls to cellfun with double quoted function names. diff -r 7bd29d875af1 -r cefd568ea073 scripts/general/accumarray.m --- a/scripts/general/accumarray.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/general/accumarray.m Sat Aug 06 18:03:18 2011 -0700 @@ -72,7 +72,7 @@ endif if (iscell (subs)) - subs = cellfun (@vec, subs, "uniformoutput", false); + subs = cellfun ("vec", subs, "uniformoutput", false); ndims = numel (subs); if (ndims == 1) subs = subs{1}; @@ -149,7 +149,7 @@ if (ndims > 1) if (isempty (sz)) if (iscell (subs)) - sz = cellfun (@max, subs); + sz = cellfun ("max", subs); else sz = max (subs, [], 1); endif diff -r 7bd29d875af1 -r cefd568ea073 scripts/general/arrayfun.m --- a/scripts/general/arrayfun.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/general/arrayfun.m Sat Aug 06 18:03:18 2011 -0700 @@ -154,7 +154,7 @@ args = varargin(1:nargs); opts = varargin(nargs+1:end); - args = cellfun (@num2cell, args, "UniformOutput", false, + args = cellfun ("num2cell", args, "UniformOutput", false, "ErrorHandler", @arg_class_error); [varargout{1:max(1, nargout)}] = cellfun (func, args{:}, opts{:}); diff -r 7bd29d875af1 -r cefd568ea073 scripts/general/blkdiag.m --- a/scripts/general/blkdiag.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/general/blkdiag.m Sat Aug 06 18:03:18 2011 -0700 @@ -33,7 +33,7 @@ print_usage (); endif - if (! all (cellfun (@isnumeric, varargin))) + if (! all (cellfun ("isnumeric", varargin))) error ("blkdiag: all arguments must be numeric"); endif diff -r 7bd29d875af1 -r cefd568ea073 scripts/general/cell2mat.m --- a/scripts/general/cell2mat.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/general/cell2mat.m Sat Aug 06 18:03:18 2011 -0700 @@ -43,11 +43,11 @@ else ## We only want numeric, logical, and char matrices. - valid = cellfun (@isnumeric, c); - valid |= cellfun (@islogical, c); - valid |= cellfun (@ischar, c); - validc = cellfun (@iscell, c); - valids = cellfun (@isstruct, c); + valid = cellfun ("isnumeric", c); + valid |= cellfun ("islogical", c); + valid |= cellfun ("isclass", c, "char"); + validc = cellfun ("isclass", c, "cell"); + valids = cellfun ("isclass", c, "struct"); if (! all (valid(:)) && ! all (validc(:)) && ! all (valids(:))) error ("cell2mat: wrong type elements or mixed cells, structs and matrices"); @@ -71,7 +71,7 @@ endif xdim = [1:idim-1, idim+1:nd]; cc = num2cell (c, xdim); - c = cellfun (@cat, {idim}, cc{:}, "uniformoutput", false); + c = cellfun ("cat", {idim}, cc{:}, "uniformoutput", false); endfor m = c{1}; endif diff -r 7bd29d875af1 -r cefd568ea073 scripts/general/common_size.m --- a/scripts/general/common_size.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/general/common_size.m Sat Aug 06 18:03:18 2011 -0700 @@ -52,7 +52,7 @@ endif ## Find scalar args. - nscal = cellfun (@numel, varargin) != 1; + nscal = cellfun ("numel", varargin) != 1; i = find (nscal, 1); @@ -60,7 +60,7 @@ errorcode = 0; varargout = varargin; else - match = cellfun (@size_equal, varargin, varargin(i)); + match = cellfun ("size_equal", varargin, varargin(i)); if (any (nscal &! match)) errorcode = 1; varargout = varargin; diff -r 7bd29d875af1 -r cefd568ea073 scripts/general/interp3.m --- a/scripts/general/interp3.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/general/interp3.m Sat Aug 06 18:03:18 2011 -0700 @@ -92,7 +92,7 @@ error ("interp3: expect 3-dimensional array of values"); endif x = varargin (2:4); - if (any (! cellfun (@isvector, x))) + if (any (! cellfun ("isvector", x))) for i = 2 : 3 if (! size_equal (x{1}, x{i})) error ("interp3: dimensional mismatch"); @@ -109,7 +109,7 @@ error ("interp3: expect 3-dimensional array of values"); endif x = varargin (1:3); - if (any (! cellfun (@isvector, x))) + if (any (! cellfun ("isvector", x))) for i = 2 : 3 if (! size_equal (x{1}, x{i}) || ! size_equal (x{i}, v)) error ("interp3: dimensional mismatch"); @@ -119,7 +119,7 @@ x{1} = permute (x{1}, [2, 1, 3]); endif y = varargin (5:7); - if (any (! cellfun (@isvector, y))) + if (any (! cellfun ("isvector", y))) for i = 2 : 3 if (! size_equal (y{1}, y{i})) error ("interp3: dimensional mismatch"); diff -r 7bd29d875af1 -r cefd568ea073 scripts/general/interpn.m --- a/scripts/general/interpn.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/general/interpn.m Sat Aug 06 18:03:18 2011 -0700 @@ -124,7 +124,7 @@ error ("interpn: wrong number or incorrectly formatted input arguments"); endif - if (any (! cellfun (@isvector, x))) + if (any (! cellfun ("isvector", x))) for i = 2 : nd if (! size_equal (x{1}, x{i}) || ! size_equal (x{i}, v)) error ("interpn: dimensional mismatch"); @@ -140,8 +140,8 @@ method = tolower (method); - all_vectors = all (cellfun (@isvector, y)); - different_lengths = numel (unique (cellfun (@numel, y))) > 1; + all_vectors = all (cellfun ("isvector", y)); + different_lengths = numel (unique (cellfun ("numel", y))) > 1; if (all_vectors && different_lengths) [foobar(1:numel(y)).y] = ndgrid (y{:}); y = {foobar.y}; @@ -169,7 +169,7 @@ vi(idx) = extrapval; vi = reshape (vi, yshape); elseif (strcmp (method, "spline")) - if (any (! cellfun (@isvector, y))) + if (any (! cellfun ("isvector", y))) for i = 2 : nd if (! size_equal (y{1}, y{i})) error ("interpn: dimensional mismatch"); diff -r 7bd29d875af1 -r cefd568ea073 scripts/general/private/__isequal__.m --- a/scripts/general/private/__isequal__.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/general/private/__isequal__.m Sat Aug 06 18:03:18 2011 -0700 @@ -59,16 +59,16 @@ ## All arguments must either be of the same class or they must be ## numeric values. t = (all (strcmp (class(x), - cellfun (@class, varargin, "uniformoutput", false))) + cellfun ("class", varargin, "uniformoutput", false))) || ((isnumeric (x) || islogical (x)) - && all (cellfun (@isnumeric, varargin) - | cellfun (@islogical, varargin)))); + && all (cellfun ("isnumeric", varargin) + | cellfun ("islogical", varargin)))); if (t) ## Test that everything has the same number of dimensions. s_x = size (x); s_v = cellfun (@size, varargin, "uniformoutput", false); - t = all (length (s_x) == cellfun (@length, s_v)); + t = all (length (s_x) == cellfun ("length", s_v)); endif if (t) @@ -96,8 +96,8 @@ ## Test the number of fields. fn_x = fieldnames (x); l_fn_x = length (fn_x); - fn_v = cellfun (@fieldnames, varargin, "uniformoutput", false); - t = all (l_fn_x == cellfun (@length, fn_v)); + fn_v = cellfun ("fieldnames", varargin, "uniformoutput", false); + t = all (l_fn_x == cellfun ("length", fn_v)); ## Test that all the names are equal. idx = 0; @@ -146,7 +146,7 @@ elseif (isa (x, "function_handle")) ## The == operator is overloaded for handles. - t = all (cellfun (@eq, {x}, varargin)); + t = all (cellfun ("eq", {x}, varargin)); else ## Check the numeric types. diff -r 7bd29d875af1 -r cefd568ea073 scripts/general/structfun.m --- a/scripts/general/structfun.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/general/structfun.m Sat Aug 06 18:03:18 2011 -0700 @@ -106,7 +106,7 @@ [varargout{:}] = cellfun (func, struct2cell (S), varargin{:}); if (! uniform_output) - varargout = cellfun (@cell2struct, varargout, {fieldnames(S)}, {1}, uo_str, false); + varargout = cellfun ("cell2struct", varargout, {fieldnames(S)}, {1}, uo_str, false); endif endfunction diff -r 7bd29d875af1 -r cefd568ea073 scripts/geometry/voronoi.m --- a/scripts/geometry/voronoi.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/geometry/voronoi.m Sat Aug 06 18:03:18 2011 -0700 @@ -129,7 +129,7 @@ idx = find (!infi); ll = length (idx); c = c(idx).'; - k = sum (cellfun ('length', c)); + k = sum (cellfun ("length", c)); edges = cell2mat(cellfun (@(x) [x ; [x(end), x(1:end-1)]], c, "uniformoutput", false)); diff -r 7bd29d875af1 -r cefd568ea073 scripts/io/strread.m --- a/scripts/io/strread.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/io/strread.m Sat Aug 06 18:03:18 2011 -0700 @@ -506,8 +506,8 @@ if (! idg(ii) && ! isempty (s) && s(1) == 1) ## Leading literal. Assign literal to icol, paste rest in icol + 1 ## Apply only to those cells that do have something beyond literal - jptr = find ([cellfun(@(x) length(x), words(icol+1, jptr), ... - "UniformOutput", false){:}] > e(1)); + jptr = find (cellfun("length", words(icol+1, jptr), ... + "UniformOutput", false) > e(1)); words(icol+1, :) = {""}; words(icol+1, jptr) = cellfun ... (@(x) substr(x, e(1)+1, length(x)-e(1)), words(icol, jptr), ... diff -r 7bd29d875af1 -r cefd568ea073 scripts/miscellaneous/fullfile.m --- a/scripts/miscellaneous/fullfile.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/miscellaneous/fullfile.m Sat Aug 06 18:03:18 2011 -0700 @@ -26,7 +26,7 @@ if (nargin > 0) ## Discard all empty arguments - varargin(cellfun (@isempty, varargin)) = []; + varargin(cellfun ("isempty", varargin)) = []; nargs = numel (varargin); if (nargs > 1) filename = varargin{1}; diff -r 7bd29d875af1 -r cefd568ea073 scripts/miscellaneous/getfield.m --- a/scripts/miscellaneous/getfield.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/miscellaneous/getfield.m Sat Aug 06 18:03:18 2011 -0700 @@ -50,8 +50,8 @@ print_usage (); endif subs = varargin; - flds = cellfun (@ischar, subs); - idxs = cellfun (@iscell, subs); + flds = cellfun ("isclass", subs, "char"); + idxs = cellfun ("isclass", subs, "cell"); if (all (flds | idxs)) typs = merge (flds, {"."}, {"()"}); obj = subsref (s, struct ("type", typs, "subs", subs)); diff -r 7bd29d875af1 -r cefd568ea073 scripts/miscellaneous/private/__xzip__.m --- a/scripts/miscellaneous/private/__xzip__.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/miscellaneous/private/__xzip__.m Sat Aug 06 18:03:18 2011 -0700 @@ -110,10 +110,10 @@ endfunction function [d, f] = myfileparts (files) - [d, f, ext] = cellfun (@(x) fileparts (x), files, "uniformoutput", false); + [d, f, ext] = cellfun ("fileparts", files, "uniformoutput", false); f = cellfun (@(x, y) sprintf ("%s%s", x, y), f, ext, "uniformoutput", false); - idx = cellfun (@isdir, files); + idx = cellfun ("isdir", files); d(idx) = ""; f(idx) = files(idx); endfunction diff -r 7bd29d875af1 -r cefd568ea073 scripts/miscellaneous/setfield.m --- a/scripts/miscellaneous/setfield.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/miscellaneous/setfield.m Sat Aug 06 18:03:18 2011 -0700 @@ -50,8 +50,8 @@ endif subs = varargin(1:end-1); rhs = varargin{end}; - flds = cellfun (@ischar, subs); - idxs = cellfun (@iscell, subs); + flds = cellfun ("isclass", subs, "char"); + idxs = cellfun ("isclass", subs, "cell"); if (all (flds | idxs)) typs = merge (flds, {"."}, {"()"}); obj = subsasgn (obj, struct ("type", typs, "subs", subs), rhs); diff -r 7bd29d875af1 -r cefd568ea073 scripts/miscellaneous/what.m --- a/scripts/miscellaneous/what.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/miscellaneous/what.m Sat Aug 06 18:03:18 2011 -0700 @@ -90,7 +90,7 @@ if (length (f) > 0) printf ("%s %s:\n\n", msg, p); - maxlen = max (cellfun (@length, f)); + maxlen = max (cellfun ("length", f)); ncols = max (1, floor (terminal_size()(2) / (maxlen + 3))); fmt = ""; for i = 1: ncols diff -r 7bd29d875af1 -r cefd568ea073 scripts/pkg/pkg.m --- a/scripts/pkg/pkg.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/pkg/pkg.m Sat Aug 06 18:03:18 2011 -0700 @@ -369,8 +369,8 @@ unwind_protect if (octave_forge) - [urls, local_files] = cellfun (@get_forge_download, files, "uniformoutput", false); - [files, succ] = cellfun (@urlwrite, urls, local_files, "uniformoutput", false); + [urls, local_files] = cellfun ("get_forge_download", files, "uniformoutput", false); + [files, succ] = cellfun ("urlwrite", urls, local_files, "uniformoutput", false); succ = [succ{:}]; if (! all (succ)) i = find (! succ, 1); @@ -382,7 +382,7 @@ global_list, global_install); unwind_protect_cleanup - cellfun (@unlink, local_files); + cellfun ("unlink", local_files); end_unwind_protect case "uninstall" @@ -1418,7 +1418,7 @@ if (isempty (filenames)) idx = []; else - idx = cellfun (@is_architecture_dependent, filenames); + idx = cellfun ("is_architecture_dependent", filenames); endif archdependent = filenames (idx); archindependent = filenames (!idx); diff -r 7bd29d875af1 -r cefd568ea073 scripts/plot/axis.m --- a/scripts/plot/axis.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/plot/axis.m Sat Aug 06 18:03:18 2011 -0700 @@ -323,10 +323,10 @@ data(data<=0) = NaN; end if (iscell (data)) - data = data (find (! cellfun (@isempty, data))); + data = data (find (! cellfun ("isempty", data))); if (! isempty (data)) - lims_min = min (cellfun (@min, cellfun (@min, data, 'uniformoutput', false)(:))); - lims_max = max (cellfun (@max, cellfun (@max, data, 'uniformoutput', false)(:))); + lims_min = min (cellfun ("min", cellfun ("min", data, 'uniformoutput', false)(:))); + lims_max = max (cellfun ("max", cellfun ("max", data, 'uniformoutput', false)(:))); lims = [lims_min, lims_max]; else lims = [0, 1]; diff -r 7bd29d875af1 -r cefd568ea073 scripts/plot/pareto.m --- a/scripts/plot/pareto.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/plot/pareto.m Sat Aug 06 18:03:18 2011 -0700 @@ -66,11 +66,11 @@ if (ischar (y)) y = cellstr (y); else - y = cellfun (@num2str, num2cell (y), "uniformoutput", false); + y = cellfun ("num2str", num2cell (y), "uniformoutput", false); endif endif else - y = cellfun (@int2str, num2cell (1 : numel(x)), + y = cellfun ("int2str", num2cell (1 : numel(x)), "uniformoutput", false); endif diff -r 7bd29d875af1 -r cefd568ea073 scripts/plot/private/__ghostscript__.m --- a/scripts/plot/private/__ghostscript__.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/plot/private/__ghostscript__.m Sat Aug 06 18:03:18 2011 -0700 @@ -44,7 +44,7 @@ cleanup_cmd = ""; args = varargin; - n = find (cellfun (@isstruct, args)); + n = find (cellfun ("isclass", args, "struct")); if (! isempty (n)) f = fieldnames (args{n}); for m = 1:numel(f) diff -r 7bd29d875af1 -r cefd568ea073 scripts/plot/private/__go_draw_axes__.m --- a/scripts/plot/private/__go_draw_axes__.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/plot/private/__go_draw_axes__.m Sat Aug 06 18:03:18 2011 -0700 @@ -1312,7 +1312,7 @@ fputs (plot_stream, "unset hidden3d;\n"); endif - have_data = (! (isempty (data) || all (cellfun (@isempty, data)))); + have_data = (! (isempty (data) || all (cellfun ("isempty", data)))); ## Note we don't use the [xy]2range of gnuplot as we don't use the ## dual axis plotting features of gnuplot. @@ -2328,7 +2328,7 @@ l = length (s) - length (strfind(s,'{')) - length (strfind(s,'}')); m = regexp (s, '/([\w-]+|[\w-]+=\d+)', 'matches'); if (!isempty (m)) - l = l - sum (cellfun (@length, m)); + l = l - sum (cellfun ("length", m)); endif endfunction diff -r 7bd29d875af1 -r cefd568ea073 scripts/plot/private/__patch__.m --- a/scripts/plot/private/__patch__.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/plot/private/__patch__.m Sat Aug 06 18:03:18 2011 -0700 @@ -134,7 +134,7 @@ endif else args = varargin; - if (any(cellfun (@(x) strcmpi(x,"faces") || strcmpi(x, "vertices"), args))) + if (any (strcmpi (args, "faces") | strcmpi (args, "vertices"))) args = setdata (args); else args = setvertexdata (args); diff -r 7bd29d875af1 -r cefd568ea073 scripts/plot/refreshdata.m --- a/scripts/plot/refreshdata.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/plot/refreshdata.m Sat Aug 06 18:03:18 2011 -0700 @@ -83,7 +83,7 @@ obj = get (h (i)); fldnames = fieldnames (obj); m = regexpi (fieldnames(obj), '^.+datasource$', "match"); - idx = cellfun (@(x) !isempty(x), m); + idx = ! cellfun ("isempty", m); if (any (idx)) tmp = m(idx); props = [props; {vertcat(tmp{:})}]; diff -r 7bd29d875af1 -r cefd568ea073 scripts/plot/whitebg.m --- a/scripts/plot/whitebg.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/plot/whitebg.m Sat Aug 06 18:03:18 2011 -0700 @@ -74,7 +74,7 @@ if (isroot) fac = get (0, "factory"); fields = fieldnames (fac); - fieldindex = intersect (find (!cellfun (@isempty, regexp(fields, 'color'))), union (find (!cellfun (@isempty, regexp(fields, 'factoryaxes.*'))), find (!cellfun (@isempty, regexp(fields, 'factoryfigure.*'))))); + fieldindex = intersect (find (!cellfun ("isempty", regexp(fields, 'color'))), union (find (!cellfun ("isempty", regexp(fields, 'factoryaxes.*'))), find (!cellfun ("isempty", regexp(fields, 'factoryfigure.*'))))); ## Check whether the factory value has been replaced for nf = 1 : numel (fieldindex); @@ -104,7 +104,7 @@ for nh = 1 : numel(h) p = get (h (nh)); fields = fieldnames (p); - fieldindex = find (!cellfun (@isempty, regexp(fields, 'color'))); + fieldindex = find (!cellfun ("isempty", regexp(fields, 'color'))); if (numel (fieldindex)) for nf = 1 : numel (fieldindex); field = fields {fieldindex (nf)}; @@ -121,7 +121,7 @@ def = get (h (nh), "default"); fields = fieldnames (def); if (! isempty (fields)) - fieldindex = find (!cellfun (@isempty, regexp(fields, 'color'))); + fieldindex = find (!cellfun ("isempty", regexp(fields, 'color'))); for nf = 1 : numel (fieldindex) defaultfield = fields {fieldindex (nf)}; defaultvalue = 1 - subsref (def, struct ("type", ".", "subs", defaultfield)); diff -r 7bd29d875af1 -r cefd568ea073 scripts/specfun/lcm.m --- a/scripts/specfun/lcm.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/specfun/lcm.m Sat Aug 06 18:03:18 2011 -0700 @@ -34,7 +34,7 @@ if (nargin > 1) if (common_size (varargin{:}) != 0) error ("lcm: all args must be of the same size or scalar"); - elseif (! all (cellfun (@isnumeric, varargin))) + elseif (! all (cellfun ("isnumeric", varargin))) error ("lcm: all arguments must be numeric"); endif diff -r 7bd29d875af1 -r cefd568ea073 scripts/strings/index.m --- a/scripts/strings/index.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/strings/index.m Sat Aug 06 18:03:18 2011 -0700 @@ -62,13 +62,13 @@ if (strcmp (direction, "last")) if (iscell (f)) - n = cellfun (@min, f); + n = cellfun ("min", f); else n = f(end); endif elseif (strcmp (direction, "first")) if (iscell (f)) - n = cellfun (@max, f); + n = cellfun ("max", f); else n = f(1); endif diff -r 7bd29d875af1 -r cefd568ea073 scripts/strings/strcat.m --- a/scripts/strings/strcat.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/strings/strcat.m Sat Aug 06 18:03:18 2011 -0700 @@ -61,14 +61,14 @@ elseif (nargin > 1) ## Convert to cells of strings uo = "uniformoutput"; - reals = cellfun (@isreal, varargin); + reals = cellfun ("isreal", varargin); if (any (reals)) - varargin(reals) = cellfun (@char, varargin(reals), uo, false); + varargin(reals) = cellfun ("char", varargin(reals), uo, false); endif - chars = cellfun (@ischar, varargin); + chars = cellfun ("isclass", varargin, "char"); allchar = all (chars); - varargin(chars) = cellfun (@cellstr, varargin(chars), uo, false); - if (! all (cellfun (@iscell, varargin))) + varargin(chars) = cellfun ("cellstr", varargin(chars), uo, false); + if (! all (cellfun ("isclass", varargin, "cell"))) error ("strcat: inputs must be strings or cells of strings"); endif @@ -81,7 +81,7 @@ endif ## Cellfun handles everything for us. - st = cellfun (@horzcat, varargin{:}, uo, false); + st = cellfun ("horzcat", varargin{:}, uo, false); if (allchar) ## If all inputs were strings, return strings. diff -r 7bd29d875af1 -r cefd568ea073 scripts/strings/strmatch.m --- a/scripts/strings/strmatch.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/strings/strmatch.m Sat Aug 06 18:03:18 2011 -0700 @@ -71,7 +71,7 @@ endif if (exact) ## We can't just use strcmp, because we need to ignore whitespace. - B = cellfun (@strtrimr, A(idx), "uniformoutput", false); + B = cellfun ("strtrimr", A(idx), "uniformoutput", false); idx = idx (strcmp (s, B)); endif elseif (ischar (A)) diff -r 7bd29d875af1 -r cefd568ea073 scripts/strings/validatestring.m --- a/scripts/strings/validatestring.m Fri Aug 05 20:36:10 2011 -0700 +++ b/scripts/strings/validatestring.m Sat Aug 06 18:03:18 2011 -0700 @@ -118,7 +118,7 @@ ## are the matches a substring of each other, if so, choose the ## shortest. If not, raise an error. match_idx = find (matches); - match_l = cellfun (@length, strarray(match_idx)); + match_l = cellfun ("length", strarray(match_idx)); longest_idx = find (match_l == max (match_l), 1); shortest_idx = find (match_l == min (match_l), 1); longest = strarray(match_idx)(longest_idx);