This is a static copy of a profile reportHome
ancestor (4 calls, 0.016 sec)
Generated 15-Mar-2007 12:02:03 using real time.
M-function in file C:\Program Files\MATLAB71\toolbox\matlab\graphics\ancestor.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 |
21 | nargchk(2,4,nargin); | 4 | 0.016 s | 100.0% |  |
41 | end | 4 | 0 s | 0% |  |
40 | p = get(handle(p),'parent'); | 4 | 0 s | 0% |  |
39 | while ~isempty(p) && ~... | 4 | 0 s | 0% |  |
38 | if nargin==2 % ancestor(h,type... | 4 | 0 s | 0% |  |
Other lines & overhead | | | 0 s | 0% |  |
Totals | | | 0.016 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
ishghandle | M-function | 4 | 0 s | 0% |  |
ancestor>isatype | M-subfunction | 8 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.016 s | 100.0% |  |
Totals | | | 0.016 s | 100% | |
M-Lint results
No M-Lint messages.Coverage results
[ Show coverage for parent directory ]
Total lines in file | 56 |
Non-code lines (comments, blank lines) | 25 |
Code lines (lines that can run) | 31 |
Code lines that did run | 7 |
Code lines that did not run | 24 |
Coverage (did run/can run) | 22.58 % |
Function listing
time calls line
1 function p = ancestor(p,type,varargin)
2 %ANCESTOR Get object ancestor.
3 % P = ANCESTOR(H,TYPE) returns the handle of the closest ancestor
4 % of h of one of the types in TYPE, or empty if none exists. TYPE
5 % may be a single string (single type) or cell array of strings
6 % (types). If H is a vector of handles the P is a cell array of the
7 % same length as H and P{n} is the ancestor of H(n). If H has one
8 % of the specified types then the ancestor of H is H itself.
9 % P = ANCESTOR(H,TYPE,'TOPLEVEL') finds the highest level ancestor of
10 % one of the types in TYPE
11 %
12 % If H is not an Handle Graphics object, ANCESTOR returns empty.
13 %
14 % Examples:
15 % p = ancestor(gca,'figure');
16 % p = ancestor(gco,{'hgtransform','hggroup','axes'},'toplevel');
17
18 % Copyright 1984-2004 The MathWorks, Inc.
19 % $Revision: 1.1.6.9 $ $Date: 2004/08/16 01:47:07 $
20
0.02 4 21 nargchk(2,4,nargin);
22
4 23 if ~ishghandle(p)
24 p = [];
25 return;
26 end
27
4 28 if length(p) > 1
29 n = length(p);
30 pv = cell(n,1);
31 for k=1:n
32 pv{k} = ancestor(p(k),type,varargin{:});
33 end
34 p = pv;
35 return;
36 end
37
4 38 if nargin==2 % ancestor(h,type)
4 39 while ~isempty(p) && ~isatype(p,type)
4 40 p = get(handle(p),'parent');
4 41 end
42 elseif nargin==3 % ancestor(h,type,'toplevel')
43 P=[];
44 if isatype(p,type)
45 P = p;
46 end
47 while ~isempty(p)
48 p = get(handle(p),'parent');
49 if isatype(p,type)
50 P = p;
51 end
52 end
53 p=P;
54 end
55
56 %-------------------------------------------------------------%
Other subfunctions in this file are not included in this listing.