comparison scripts/strings/index.m @ 12931:cefd568ea073

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.
author Rik <octave@nomad.inbox5.com>
date Sat, 06 Aug 2011 18:03:18 -0700
parents c792872f8942
children 1a6537dbce7b
comparison
equal deleted inserted replaced
12930:7bd29d875af1 12931:cefd568ea073
60 f = 0; 60 f = 0;
61 endif 61 endif
62 62
63 if (strcmp (direction, "last")) 63 if (strcmp (direction, "last"))
64 if (iscell (f)) 64 if (iscell (f))
65 n = cellfun (@min, f); 65 n = cellfun ("min", f);
66 else 66 else
67 n = f(end); 67 n = f(end);
68 endif 68 endif
69 elseif (strcmp (direction, "first")) 69 elseif (strcmp (direction, "first"))
70 if (iscell (f)) 70 if (iscell (f))
71 n = cellfun (@max, f); 71 n = cellfun ("max", f);
72 else 72 else
73 n = f(1); 73 n = f(1);
74 endif 74 endif
75 else 75 else
76 error ("index: DIRECTION must be either \"first\" or \"last\""); 76 error ("index: DIRECTION must be either \"first\" or \"last\"");