This is a static copy of a profile reportHome
close (35 calls, 0.516 sec)
Generated 15-Mar-2007 12:01:46 using real time.
M-function in file C:\Program Files\MATLAB71\toolbox\matlab\graphics\close.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 |
143 | status = request_close(h); | 35 | 0.359 s | 69.7% |  |
102 | h = setdiff(h,filterFigs); | 29 | 0.063 s | 12.1% |  |
94 | sfFigs = [sfFigs; findobj(h, '... | 29 | 0.031 s | 6.1% |  |
95 | sfFigs = [sfFigs; findobj(h, '... | 29 | 0.016 s | 3.0% |  |
92 | sfFigs = [sfFigs; findobj(h, '... | 29 | 0.016 s | 3.0% |  |
Other lines & overhead | | | 0.031 s | 6.1% |  |
Totals | | | 0.516 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
close>request_close | M-subfunction | 35 | 0.359 s | 69.7% |  |
setdiff | M-function | 87 | 0.063 s | 12.1% |  |
close>checkfigs | M-subfunction | 35 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.094 s | 18.2% |  |
Totals | | | 0.516 s | 100% | |
M-Lint results
Line number | Message |
43 | Function 'ISSTR' is deprecated. Use 'ISCHAR' instead. |
82 | Use || instead of | as the OR operator in (scalar) conditional statements. |
132 | Use || instead of | as the OR operator in (scalar) conditional statements. |
Coverage results
[ Show coverage for parent directory ]
Total lines in file | 149 |
Non-code lines (comments, blank lines) | 56 |
Code lines (lines that can run) | 93 |
Code lines that did run | 52 |
Code lines that did not run | 41 |
Coverage (did run/can run) | 55.91 % |
Function listing
time calls line
1 function st = close(varargin)
2 %CLOSE Close figure.
3 % CLOSE(H) closes the window with handle H.
4 % CLOSE, by itself, closes the current figure window.
5 %
6 % CLOSE('name') closes the named window.
7 %
8 % CLOSE ALL closes all the open figure windows.
9 % CLOSE ALL HIDDEN closes hidden windows as well.
10 %
11 % STATUS = CLOSE(...) returns 1 if the specified windows were closed
12 % and 0 otherwise.
13 %
14 % See also DELETE.
15
16 % CLOSE ALL FORCE unconditionally closes all windows by deleting them
17 % without executing the close request function.
18 %
19 % CLOSE ALL may be over-ridden by setting appdata on the figure to
20 % 'IgnoreCloseAll' with a value of 1.
21 % setappdata(FIGH, 'IgnoreCloseAll', 1);
22 %
23 % CLOSE ALL FORCE may be over-ridden by setting appdata on the figure to
24 % 'IgnoreCloseAll' with a value of 2. This over-rides CLOSE ALL as well.
25 % setappdata(FIGH, 'IgnoreCloseAll', 2);
26
27 % Copyright 1984-2005 The MathWorks, Inc.
28 % $Revision: 5.42.4.4 $ $Date: 2005/06/21 19:32:13 $
29
< 0.01 35 30 h = [];
< 0.01 35 31 closeAll = 0;
< 0.01 35 32 closeForce = 0;
< 0.01 35 33 closeHidden = 0;
< 0.01 35 34 status = 1;
35
35 36 if nargin == 0
5 37 h = get(0,'CurrentFigure');
30 38 else
39 % Input can be <handle>, '<handle>', 'force', and/or 'all' in any order
30 40 for i=1:nargin
30 41 cur_arg = varargin{i};
42
30 43 if isstr(cur_arg)
29 44 switch lower(cur_arg)
29 45 case 'force',
46 closeForce = 1;
29 47 case 'all',
< 0.01 29 48 closeAll = 1;
49 case 'hidden',
50 closeHidden = 1;
51 case 'gcf',
52 h = [h gcf];
53 case 'gcbf',
54 h = [h gcbf];
55 otherwise
56 %Find Figure with given name, or it is command style call
57 hlist = findobj(get(0,'children'),'flat','name',cur_arg);
58 if ~isempty(hlist)
59 h = [h hlist];
60 else
61 num = str2double(cur_arg);
62 if ~isnan(num)
63 h = [h num];
64 end
65 end
66 end
< 0.01 1 67 else
1 68 h = [h cur_arg];
< 0.01 1 69 if isempty(h), % make sure close([]) does nothing:
70 if nargout==1, st = status; end
71 return
72 end
1 73 end
30 74 end
75
76 % If h is empty that this point, define it by context.
30 77 if isempty(h)
78 % If there were other args besides the special ones, error out
29 79 if (closeHidden + closeForce + closeAll) < nargin
80 error('Specified window does not exist.');
81 end
29 82 if closeHidden | closeForce
83 hhmode = get(0,'showhiddenhandles');
84 set(0,'showhiddenhandles','on');
85 end
29 86 if closeAll
29 87 h = findobj(get(0,'Children'), 'flat','type','figure');
88 % Find all Stateflow figures to filter out.
89 % NOTE: New "special" figures should set the appdata mentioned
90 % below instead of adding a Tag to this filtering code.
0.02 29 91 sfFigs = findobj(h, 'Tag', 'SFCHART');
0.02 29 92 sfFigs = [sfFigs; findobj(h, 'Tag', 'DEFAULT_SFCHART')];
29 93 sfFigs = [sfFigs; findobj(h, 'Tag', 'SFEXPLR')];
0.03 29 94 sfFigs = [sfFigs; findobj(h, 'Tag', 'SF_DEBUGGER')];
0.02 29 95 sfFigs = [sfFigs; findobj(h, 'Tag', 'SF_SAFEHOUSE')];
29 96 sfFigs = [sfFigs; findobj(h, 'Tag', 'SF_SNR')];
97
98 % Find all Simulink scopes to filter out.
29 99 slFigs = findobj(h, 'Tag', 'SIMULINK_SIMSCOPE_FIGURE');
100
29 101 filterFigs = [sfFigs; slFigs];
0.06 29 102 h = setdiff(h,filterFigs);
103
104 % If any of these figs have IgnoreCloseAll set to 1, they would
105 % override closeAll only. If it is set to 2, they would override
106 % closeAll and closeForce.
< 0.01 29 107 closeAllOverride = [];
< 0.01 29 108 closeForceOverride = [];
29 109 for i =1:length(h)
40 110 if isappdata(h(i),'IgnoreCloseAll')
111 ignoreFlag = getappdata(h(i), 'IgnoreCloseAll');
112 if isnumeric(ignoreFlag)
113 if (ignoreFlag == 1)
114 closeAllOverride = [closeAllOverride; h(i)];
115 elseif (ignoreFlag == 2)
116 closeForceOverride = [closeForceOverride; h(i)];
117 end
118 end
119 end
40 120 end
121
122 % For closeForceOverride, closeAll and closeForce should honor it
123 % For closeAllOverride, only closeAll should honor it.
29 124 h = setdiff(h, closeForceOverride);
29 125 if ~closeForce
126 % it is just closeAll
29 127 h = setdiff(h, closeAllOverride);
29 128 end
129 else
130 h = get(0,'CurrentFigure');
131 end
29 132 if closeHidden | closeForce
133 set(0,'showhiddenhandles',hhmode)
134 end
29 135 end
30 136 end
137
35 138 if ~checkfigs(h), error('Invalid figure handle.'); end
139
35 140 if closeForce
141 delete(h)
35 142 else
0.36 35 143 status = request_close(h);
35 144 end
145
< 0.01 35 146 if nargout==1, st = status; end
147
148
149 %------------------------------------------------
Other subfunctions in this file are not included in this listing.