This is a static copy of a profile reportHome
hggetbehavior>localGet (5 calls, 0.040 sec)
Generated 28-Feb-2011 19:17:58 using cpu time.
M-subfunction in file /Applications/MATLAB_R2010a.app/toolbox/matlab/graphics/hggetbehavior.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 |
90 | b = hgbehaviorfactory(bn); | 5 | 0.030 s | 75.0% |  |
87 | bn = behavior_name{n}; | 5 | 0.010 s | 25.0% |  |
103 | end | 5 | 0 s | 0% |  |
99 | end | 5 | 0 s | 0% |  |
98 | ret_h(end+1) = b; | 5 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0.040 s | 100% | |
Children (called functions)
M-Lint results
Line number | Message |
98 | The variable 'ret_h' appears to change size on every loop iteration. Consider preallocating for speed. |
101 | The variable 'ret_h' appears to change size on every loop iteration. Consider preallocating for speed. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 28 |
Non-code lines (comments, blank lines) | 6 |
Code lines (lines that can run) | 22 |
Code lines that did run | 17 |
Code lines that did not run | 5 |
Coverage (did run/can run) | 77.27 % |
Function listing
time calls line
76 function [ret_h] = localGet(h,behavior_name)
77 % ToDo: Optimize to avoid excessive looping
78
5 79 bb = get(h,'Behavior');
5 80 ret_h = handle([]);
81
5 82 if ischar(behavior_name)
5 83 behavior_name = {behavior_name};
5 84 end
85
5 86 for n = 1:length(behavior_name)
< 0.01 5 87 bn = behavior_name{n};
5 88 b = localPeek(h,bn);
5 89 if isempty(b)
0.03 5 90 b = hgbehaviorfactory(bn);
5 91 if ~isempty(b)
5 92 if ~dosupport(b,h)
93 error('MATLAB:GRAPHICS:HGGETBEHAVIOR',...
94 'Behavior object does not support this handle type.')
95 end
5 96 bb(1).(behavior_name{n}) = b;
5 97 set(h,'Behavior',bb);
5 98 ret_h(end+1) = b;
5 99 end
100 else
101 ret_h(end+1) = b;
102 end
5 103 end
Other subfunctions in this file are not included in this listing.