This is a static copy of a profile report

Home

graphics/private/clo (253 calls, 0.842 sec)
Generated 05-Aug-2011 13:01:33 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/graphics/private/clo.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
clffunction10
clafunction243
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
49
kids_to_delete = setdiff(finda...
2430.284 s33.8%
83
reset(handleobj);
2430.197 s23.4%
79
delete(kids_to_delete);
2530.197 s23.4%
96
if isprop(tobj,'ColorIndex')
2430.044 s5.2%
44
hsave = find_kids(obj, hsave);
2530.033 s3.9%
All other lines  0.087 s10.4%
Totals  0.842 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
setdifffunction4960.164 s19.5%
findallfunction2430.142 s16.9%
scribe.legend.init>PlotAxesClearedsubfunction90.077 s9.1%
ispropfunction2430.044 s5.2%
graphics/private/clo>find_kidssubfunction2530.033 s3.9%
legendcolorbarlayoutfunction90.011 s1.3%
scribe.legend.init>PlotAxesDeletedsubfunction30.011 s1.3%
subplot>axesDestroyedsubfunction500.011 s1.3%
findobjfunction100.011 s1.3%
...nd.init>PlotAxesChangedFontPropertiessubfunction120 s0%
gcbofunction90 s0%
Self time (built-ins, overhead, etc.)  0.339 s40.3%
Totals  0.842 s100% 
Code Analyzer results
Line numberMessage
Coverage results
[ Show coverage for parent directory ]
Total lines in function107
Non-code lines (comments, blank lines)35
Code lines (lines that can run)72
Code lines that did run48
Code lines that did not run24
Coverage (did run/can run)66.67 %
Function listing
   time   calls  line
1 function ret_obj = clo(obj, in1, in2)
2 %CLO Clear object
3 % CLO(H) deletes all children of the object with visible handles.
4 %
5 % CLO(..., 'reset') deletes all children (including ones with hidden
6 % handles) and also resets all object properties to their default
7 % values.
8 %
9 % CLO(..., HSAVE) deletes all children except those specified in
10 % HSAVE.
11 %
12 % See also CLF, CLA, RESET, HOLD.
13
14 % Copyright 1984-2009 The MathWorks, Inc.
15
16 % decode input args:
253 17 hsave = [];
253 18 do_reset = '';
19
253 20 error(nargchk(1, 3, nargin));
21
253 22 if nargin > 1
243 23 if ischar(in1), do_reset = in1; else hsave = in1; end
243 24 if nargin > 2
243 25 if ischar(in2), do_reset = in2; else hsave = in2; end
243 26 end
243 27 end
28
29 % error-check input args
0.01 253 30 if ~isempty(do_reset)
243 31 if ~strcmp(do_reset, 'reset')
32 error('MATLAB:clo:unknownOption','Unknown command option.')
243 33 else
243 34 do_reset = 1;
243 35 end
10 36 else
10 37 do_reset = 0;
10 38 end
39
253 40 if any(~ishghandle(hsave))
41 error('MATLAB:clo:invalidHandle','Bad handle')
42 end
43
0.03 253 44 hsave = find_kids(obj, hsave);
45
253 46 if do_reset
243 47 if ishghandle(obj)
243 48 if ~feature('HgUsingMATLABClasses')
0.28 243 49 kids_to_delete = setdiff(findall(obj,'serializable','on','-depth',1),obj);
50 else
51 % HG2 does not hide the data brushing toolbar which leaves an
52 % additional uimenu object. Filtering this additional object till
53 % g586144 is completed.
54 uiMenuChild = findall(obj, 'Label','Building...');
55 kids = setdiff(allchild(obj), uiMenuChild);
56 kids_to_delete = intersect(findall(kids, 'serializable', 'on'), kids);
57 end
58 else
59 kids_to_delete = get(obj,'Children'); % Only get 'real' children
60 kids_to_delete = findobj(kids_to_delete,'flat', 'serializable','on');
61 end
10 62 else
0.01 10 63 kids_to_delete = findobj(get(obj,'Children'),'flat',...
64 'HandleVisibility','on', 'serializable','on');
10 65 end
66
0.01 253 67 if feature('HgUsingMatlabClasses')
68 hlen = length(hsave);
69 for i=1:hlen
70 mask = kids_to_delete == hsave(i);
71 if any(mask)
72 kids_to_delete = kids_to_delete(~mask);
73 end
74 end
253 75 else
0.02 253 76 kids_to_delete = setdiff(kids_to_delete, hsave);
253 77 end
78
0.20 253 79 delete(kids_to_delete);
80
253 81 if do_reset,
0.01 243 82 handleobj = obj(ishghandle(obj));
0.20 243 83 reset(handleobj);
84 % reset might have invalidated more handles
243 85 handleobj = handleobj(ishghandle(handleobj));
86 % look for appdata for holding color and linestyle
0.01 243 87 for k=1:length(handleobj)
243 88 tobj = handleobj(k);
0.01 243 89 if isappdata(tobj,'PlotHoldStyle')
90 90 rmappdata(tobj,'PlotHoldStyle')
90 91 end
243 92 if isappdata(tobj,'PlotColorIndex')
90 93 rmappdata(tobj,'PlotColorIndex')
90 94 rmappdata(tobj,'PlotLineStyleIndex')
90 95 end
0.04 243 96 if isprop(tobj,'ColorIndex')
97 set(tobj,'ColorIndex',1);
98 set(tobj,'LineStyleIndex',1);
99 end
243 100 end
243 101 end
102
103 % now that IntegerHandle can be changed by reset, make sure
104 % we're returning the new handle:
253 105 if (nargout ~= 0)
106 ret_obj = obj(ishghandle(obj));
107 end

Other subfunctions in this file are not included in this listing.