This is a static copy of a profile reportHome
clf (10 calls, 0.120 sec)
Generated 05-Aug-2011 13:01:36 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/graphics/clf.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
82 | clo(fig, extra{:}); | 10 | 0.087 s | 72.7% |  |
87 | fig = double(fig_handle); | 10 | 0.011 s | 9.1% |  |
75 | set(double(fig),'CurrentAxes',... | 8 | 0.011 s | 9.1% |  |
101 | if (nargout ~= 0) | 10 | 0 s | 0% |  |
96 | end | 10 | 0 s | 0% |  |
All other lines | | | 0.011 s | 9.1% |  |
Totals | | | 0.120 s | 100% | |
Children (called functions)
Code Analyzer results
Line number | Message |
94 | Best practice is for CATCH to be followed by an identifier that gets the error information. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 103 |
Non-code lines (comments, blank lines) | 47 |
Code lines (lines that can run) | 56 |
Code lines that did run | 29 |
Code lines that did not run | 27 |
Coverage (did run/can run) | 51.79 % |
Function listing
time calls line
1 function ret_fig = clf(varargin)
2 %CLF Clear current figure.
3 % CLF deletes all children of the current figure with visible handles.
4 %
5 % CLF RESET deletes all children (including ones with hidden
6 % handles) and also resets all figure properties, except Position,
7 % Units, PaperPosition and PaperUnits, to their default values.
8 %
9 % CLF(FIG) or CLF(FIG,'RESET') clears the single figure with handle FIG.
10 %
11 % FIG_H = CLF(...) returns the handle of the figure.
12 %
13 % See also CLA, RESET, HOLD.
14
15 % CLF(..., HSAVE) deletes all children except those specified in
16 % HSAVE.
17 %
18 % Copyright 1984-2009 The MathWorks, Inc.
19 % $Revision: 5.22.4.21 $ $Date: 2009/12/28 04:17:47 $
20
10 21 if nargin>0 && length(varargin{1})==1 && ishghandle(varargin{1}) && strcmpi(get(varargin{1},'Type'),'figure')
22 % If first argument is a single figure handle, apply CLF to it
23 fig = varargin{1};
24 extra = varargin(2:end);
10 25 elseif nargin>0 && length(varargin{1})==1 && ~ishghandle(varargin{1})
26 error('MATLAB:clf:InvalidFigureHandle', 'Invalid figure handle');
10 27 else
28 % Default target is current figure
10 29 fig = gcf;
10 30 extra = varargin;
10 31 end
32
33 % annotations are cleared by hand since the handle is hidden
10 34 scribeax = getappdata(fig,'Scribe_ScribeOverlay');
10 35 if any(ishghandle(scribeax)),
36 delete(get(scribeax,'Children'));
37 end
38
39 % if IntegerHandle is 'off', then a numeric handle becomes invalid when RESET
40 % is called in CLO.
10 41 fig_was_numeric = true;
10 42 if isnumeric(fig)
10 43 [ lmsg lid ] = lastwarn;
10 44 ws = warning('query','MATLAB:handle:hg2');
10 45 warning('off','MATLAB:handle:hg2')
46
10 47 fig_handle = handle(fig);
48
10 49 warning(ws.state,ws.identifier)
10 50 lastwarn( lmsg, lid );
51 else
52 fig_was_numeric = false;
53 fig_handle = fig;
54 end
55
56 % If the reset option was selected, clear any active modes and any link plot
57 % state.
10 58 if ~isempty(extra)
59 scribeclearmode(fig_handle);
60 if isprop(fig_handle,'ModeManager') && ~isempty(get(fig_handle,'ModeManager'))
61 clearModes(get(fig_handle,'ModeManager'));
62 set(fig_handle,'ModeManager','');
63 uiundo(fig_handle,'clear');
64 end
65 if ~isdeployed % linkdata is not deployable
66 linkDataState = linkdata(fig);
67 if strcmp(get(linkDataState,'Enable'),'on')
68 linkdata(fig,'off');
69 end
70 end
71 end
72
10 73 if ~isempty(get(fig,'CurrentAxes'))
8 74 if(~feature('useGBT2'))
0.01 8 75 set(double(fig),'CurrentAxes',[]);
76 else
77 set(fig,'CurrentAxes',[]);
78 end
8 79 end
80
81
0.09 10 82 clo(fig, extra{:});
83
84
85 % cast back to double
10 86 if fig_was_numeric
0.01 10 87 fig = double(fig_handle);
10 88 end
89
90 % cause a complete redraw of the figure, so that movie frame remnants
91 % are cleared as well
10 92 try
10 93 refresh(fig)
94 catch
95 %228992 No operation since no figure exists
10 96 end
97
98
99 % now that IntegerHandle can be changed by reset, make sure
100 % we're returning the new handle:
10 101 if (nargout ~= 0)
102 ret_fig = fig;
103 end