changeset 11188:4cb1522e4d0f

Use function handle as input to cellfun, rather than quoted function name or anonymous function wrapper.
author Rik <octave@nomad.inbox5.com>
date Wed, 03 Nov 2010 17:20:56 -0700
parents 0a8e554494c9
children a3cb42b394eb
files scripts/ChangeLog scripts/general/common_size.m scripts/miscellaneous/private/__xzip__.m scripts/miscellaneous/what.m scripts/plot/pareto.m scripts/plot/private/__patch__.m
diffstat 6 files changed, 21 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Wed Nov 03 18:02:03 2010 +0800
+++ b/scripts/ChangeLog	Wed Nov 03 17:20:56 2010 -0700
@@ -1,3 +1,10 @@
+2010-11-03  Rik  <octave@nomad.inbox5.com>
+
+	* general/common_size.m, miscellaneous/private/__xzip__.m, 
+	  miscellaneous/what.m, plot/pareto.m, plot/private/__patch__.m:
+	  Use function handle as input to cellfun rather than quoted function
+	  name or anonymous function wrapper.
+
 2010-11-03  Konstantinos Poulios  <logari81@googlemail.com>
 
 	* plot/axis.m: Making 'axis equal' equivalent to 'daspect([1,1,1])'.
--- a/scripts/general/common_size.m	Wed Nov 03 18:02:03 2010 +0800
+++ b/scripts/general/common_size.m	Wed Nov 03 17:20:56 2010 -0700
@@ -53,7 +53,7 @@
   endif
 
   ## Find scalar args.
-  nscal = cellfun ("numel", varargin) != 1;
+  nscal = cellfun (@numel, varargin) != 1;
 
   i = find (nscal, 1);
 
--- a/scripts/miscellaneous/private/__xzip__.m	Wed Nov 03 18:02:03 2010 +0800
+++ b/scripts/miscellaneous/private/__xzip__.m	Wed Nov 03 17:20:56 2010 -0700
@@ -115,7 +115,7 @@
   [d, f, ext] = cellfun (@(x) fileparts (x), files, "UniformOutput", false);
   f = cellfun (@(x, y) sprintf ("%s%s", x, y), f, ext,
                "UniformOutput", false); 
-  idx = cellfun (@(x) isdir (x), files);
+  idx = cellfun (@isdir, files);
   d(idx) = "";
   f(idx) = files(idx);
 endfunction
--- a/scripts/miscellaneous/what.m	Wed Nov 03 18:02:03 2010 +0800
+++ b/scripts/miscellaneous/what.m	Wed Nov 03 17:20:56 2010 -0700
@@ -91,7 +91,7 @@
   if (length (f) > 0)
     printf ("%s %s:\n\n", msg, p)
   
-    maxlen = max (cellfun (@(x) length (x), f));
+    maxlen = max (cellfun (@length, f));
     ncols = max (1, floor (terminal_size()(2) / (maxlen + 3)));
     fmt = "";
     for i = 1: ncols
--- a/scripts/plot/pareto.m	Wed Nov 03 18:02:03 2010 +0800
+++ b/scripts/plot/pareto.m	Wed Nov 03 17:20:56 2010 -0700
@@ -66,11 +66,11 @@
       if (ischar (y))
         y = cellstr (y);
       else
-        y = cellfun (@(x) num2str (x), num2cell (y), "UniformOutput", false);
+        y = cellfun (@num2str, num2cell (y), "UniformOutput", false);
       endif
     endif
   else
-    y = cellfun (@(x) int2str (x), num2cell (1 : numel(x)), 
+    y = cellfun (@int2str, num2cell (1 : numel(x)), 
                  "UniformOutput", false);
   endif
 
--- a/scripts/plot/private/__patch__.m	Wed Nov 03 18:02:03 2010 +0800
+++ b/scripts/plot/private/__patch__.m	Wed Nov 03 17:20:56 2010 -0700
@@ -171,25 +171,25 @@
   ## Remove the readonly fields as well
   args = delfields (args, {"type", "uicontextmenu"});
   nargs = length (args);
-  idx = find (cellfun (@(x) strcmpi (x, "faces"), args))(end) + 1;
+  idx = find (strcmpi (args, "faces"), 1, "last") + 1;
   if (idx > nargs)
     faces = [];
   else
     faces = args {idx};
   endif
-  idx = find (cellfun (@(x) strcmpi (x, "vertices"), args))(end) + 1;
+  idx = find (strcmpi (args, "vertices"), 1, "last") + 1;
   if (idx > nargs)
     vert = [];
   else
     vert = args {idx};
   endif
-  idx = find (cellfun (@(x) strcmpi (x, "facevertexcdata"), args), 1, "last") + 1;
+  idx = find (strcmpi (args, "facevertexcdata"), 1, "last") + 1;
   if (isempty(idx) || idx > nargs)
     fvc = [];
   else
     fvc = args {idx};
   endif
-  idx = find (cellfun (@(x) strcmpi (x, "facecolor"), args), 1, "last") + 1;
+  idx = find (strcmpi (args, "facecolor"), 1, "last") + 1;
   if (isempty(idx) || idx > nargs)
     if (!isempty (fvc))
       fc = "flat";
@@ -238,31 +238,31 @@
   ## Remove the readonly fields as well
   args = delfields (args, {"type", "uicontextmenu"});
   nargs = length (args);
-  idx = find (cellfun (@(x) strcmpi (x, "xdata"), args))(end) + 1;
+  idx = find (strcmpi (args, "xdata"), 1, "last") + 1;
   if (idx > nargs)
     x = [];
   else
     x = args {idx};
   endif
-  idx = find (cellfun (@(x) strcmpi (x, "ydata"), args))(end) + 1;
+  idx = find (strcmpi (args, "ydata"), 1, "last") + 1;
   if (idx > nargs)
     y = [];
   else
     y = args {idx};
   endif
-  idx = find (cellfun (@(x) strcmpi (x, "zdata"), args))(end) + 1;
+  idx = find (strcmpi (args, "zdata"), 1, "last") + 1;
   if (isempty(idx) || idx > nargs)
     z = [];
   else
     z = args {idx};
   endif
-  idx = find (cellfun (@(x) strcmpi (x, "cdata"), args))(end) + 1;
+  idx = find (strcmpi (args, "cdata"), 1, "last") + 1;
   if (isempty(idx) || idx > nargs)
     c = [];
   else
     c = args {idx};
   endif
-  idx = find (cellfun (@(x) strcmpi (x, "facecolor"), args))(end) + 1;
+  idx = find (strcmpi (args, "facecolor"), 1, "last") + 1;
   if (isempty(idx) || idx > nargs)
     if (!isempty (c))
       fc = "flat";