This is a static copy of a profile reportHome
hasbehavior (102 calls, 0.000 sec)
Generated 05-Aug-2011 13:02:24 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/graphics/hasbehavior.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Lines where the most time was spent
No measurable time spent in this functionLine Number | Code | Calls | Total Time | % Time | Time Plot |
34 | has = true; | 102 | 0 s | 0% |  |
33 | if ~isappdata(h,behaviorname) | 102 | 0 s | 0% |  |
31 | if nargin == 2 | 102 | 0 s | 0% |  |
30 | behaviorname = [name,'_hgbehav... | 102 | 0 s | 0% |  |
27 | if ~ischar(name) | 102 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0 s | 0% | |
Children (called functions)
No childrenCode Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 46 |
Non-code lines (comments, blank lines) | 24 |
Code lines (lines that can run) | 22 |
Code lines that did run | 7 |
Code lines that did not run | 15 |
Coverage (did run/can run) | 31.82 % |
Function listing
time calls line
1 function has=hasbehavior(h,name,state)
2 %HASBEHAVIOR sets(enables/disables) or gets behaviors of hg objects
3 %
4 % HASBEHAVIOR(H,NAME,STATE) sets the behavior named NAME for the
5 % hg object with handle H to STATE (true or false). The NAME
6 % is case-insensitive. The name 'legend' is used by the LEGEND
7 % command to enable or disable showing the object in a legend.
8 % HAS = HASBEHAVIOR(H,NAME) returns the boolean value for the
9 % behavior NAME of H. If the behavior has not been previously
10 % set for H, then 'on' is returned.
11 %
12 % Examples:
13 % ax=axes;
14 % l=plot(rand(3,3));
15 % hasbehavior(l(1),'legend',false); % line will not be in legend
16 % hasbehavior(l(2),'legend',true); % line will be in legend
17 %
18 % linelegendable = hasbehavior(l(1),'legend'); % gets legend behavior
19
20 % Copyright 1984-2005 The MathWorks, Inc.
21
102 22 error(nargchk(2,3,nargin,'struct'));
23
102 24 if ~ishghandle(h)
25 error(id('InvalidHandle'),'First argument must be a valid handle.')
26 end
102 27 if ~ischar(name)
28 error(id('InvalidName'),'Second argument must be a string name.')
29 end
102 30 behaviorname = [name,'_hgbehavior'];
102 31 if nargin == 2
32 % if the appdata does not exist then the behavior is true
102 33 if ~isappdata(h,behaviorname)
102 34 has = true;
35 elseif isequal(false,getappdata(h,behaviorname))
36 has = false;
37 else
38 has = true;
39 end
40 else
41 if ~islogical(state) && ~isnumeric(state)
42 error(id('InvalidBehaviorState'),...
43 'Behavior state must be logical or numeric.');
44 end
45 setappdata(h,behaviorname,state)
46 end
Other subfunctions in this file are not included in this listing.