# HG changeset patch # User Rik # Date 1378436270 25200 # Node ID 1a4d036e14564d09c26f5c60140455e8cbd595a2 # Parent 50b2863d10a6693ce763a5ddbbec5600c86d7e0a struct2hdl.m: Eliminate some arrayfun instances for perforance. * scripts/plot/struct2hdl.m: Use ismember or struct array indexing to replace arrayfun instances. diff -r 50b2863d10a6 -r 1a4d036e1456 scripts/plot/struct2hdl.m --- a/scripts/plot/struct2hdl.m Thu Sep 05 17:04:40 2013 -0700 +++ b/scripts/plot/struct2hdl.m Thu Sep 05 19:57:50 2013 -0700 @@ -191,7 +191,7 @@ plty = s.properties.__plotyy_axes__; addproperty ("__plotyy_axes__", h, "any"); tmp = [p [s.handle; h]]; - tst = arrayfun (@(x) any (plty == x), tmp(1:2:end)); + tst = ismember (tmp(1:2:end), plty); if (sum (tst) == numel (plty)) for ii = 1:numel (plty) plty(ii) = tmp(find (tmp == plty(ii)) + 1); @@ -453,7 +453,8 @@ bargroup = s.properties.bargroup; oldh = s.handle; - temp = arrayfun (@(x) any(x == bargroup), [p(1:2:end) oldh]); + temp = ismember ([p(1:2:end) oldh], bargroup); + tst = sum (temp) == length (bargroup); if (isscalar (bargroup) || !tst) @@ -547,7 +548,11 @@ more off; if (strcmpi (s.properties.tag, "")) specs = s.children(s.special); - hdls = arrayfun (@(x) x.handle, specs); + if (isempty (specs)) + hdls = []; + else + hdls = [specs.handle]; + endif nh = length (hdls); msg = ""; if (! nh)