This is a static copy of a profile reportHome
scribe.legend.init>setWidthHeight (43 calls, 0.066 sec)
Generated 05-Aug-2011 13:02:21 using cpu time.
subfunction in file /usr/local/MATLAB/R2011a/toolbox/matlab/scribe/@scribe/@legend/init.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 |
264 | siz = max(methods(h,'getsize')... | 27 | 0.044 s | 66.7% |  |
279 | setappdata(double(h),'LegendOl... | 27 | 0.011 s | 16.7% |  |
273 | set(h,'Position',pos); | 18 | 0.011 s | 16.7% |  |
280 | end | 27 | 0 s | 0% |  |
278 | siz = hgconvertunits(fig,pos,g... | 27 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0.066 s | 100% | |
Children (called functions)
Code Analyzer results
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 34 |
Non-code lines (comments, blank lines) | 2 |
Code lines (lines that can run) | 32 |
Code lines that did run | 30 |
Code lines that did not run | 2 |
Coverage (did run/can run) | 93.75 % |
Function listing
time calls line
247 function setWidthHeight(hSrc,eventData,h) %#ok
43 248 if ishandle(h) && strcmp(get(h,'Units'),'normalized') && ...
249 any(strcmp(get(h,'Location'),{'none','Best'}))
27 250 if ~isempty(h.Axes) && ~isempty(getappdata(double(h.Axes),'inLayout')), return; end
27 251 pos = get(h,'Position');
27 252 oldsize = getappdata(double(h),'LegendOldSize');
27 253 parent = get(h,'Parent');
27 254 fig = parent;
27 255 if ~strcmp(get(fig,'Type'),'figure')
256 fig = ancestor(fig,'figure');
257 end
27 258 if isempty(oldsize)
9 259 oldsize = pos(3:4);
18 260 else
18 261 oldsize = hgconvertunits(fig,[0 0 oldsize],'points',get(h,'Units'),parent);
18 262 oldsize = oldsize(3:4);
18 263 end
0.04 27 264 siz = max(methods(h,'getsize'),oldsize);
27 265 if any(abs(siz-pos(3:4)) > 1e-10)
18 266 center = pos(1:2)+pos(3:4)/2;
18 267 pos = [center-siz/2 siz];
18 268 listen = h.PropertyListeners;
18 269 if ~isempty(listen)
18 270 oldstate = get(listen,'enable');
18 271 set(listen,'enable','off');
18 272 end
0.01 18 273 set(h,'Position',pos);
18 274 if ~isempty(listen)
18 275 set(listen,{'enable'},oldstate);
18 276 end
18 277 end
27 278 siz = hgconvertunits(fig,pos,get(h,'Units'),'points',parent);
0.01 27 279 setappdata(double(h),'LegendOldSize',siz(3:4));
27 280 end
Other subfunctions in this file are not included in this listing.