This is a static copy of a profile report

Home

hggetbehavior (Calls: 90, Time: 0.064 s)
Generated 16-Jul-2020 17:09:25 using performance time.
function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/graphics/hggetbehavior.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
firePrintBehaviorfunction58
Legend.doSetupfunction32
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
72
ret_h = localGet(h,behavior_na...
320.047 s73.8%
68
ret_h = localPeek(h,behavior_n...
580.011 s16.8%
57
h = handle(h);
900.002 s3.0%
67
if strcmp(flag,'-peek')
580.001 s0.9%
71
behavior_name = lower(behavior...
320.001 s0.8%
All other lines  0.003 s4.8%
Totals  0.064 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
hggetbehavior>localGetsubfunction320.047 s72.5%
hggetbehavior>localPeeksubfunction580.010 s15.0%
Self time (built-ins, overhead, etc.)  0.008 s12.5%
Totals  0.064 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function73
Non-code lines (comments, blank lines)53
Code lines (lines that can run)20
Code lines that did run16
Code lines that did not run4
Coverage (did run/can run)80.00 %
Function listing
time 
Calls 
 line
   1 
function [ret_h] = hggetbehavior(h,behavior_name,flag)
   2 
% This internal helper function may be removed in a future release.
   3 

   4 
%HGGETBEHAVIOR Convenience for getting behavior objects
   5 
%
   6 
%   HGGETBEHAVIOR 
   7 
%   With no arguments, a list of all registered behavior
   8 
%   objects is generated to the command window.
   9 
%
  10 
%   BH = HGGETBEHAVIOR(H)
  11 
%   Identical to get(H,'Behavior'), this syntax returns all 
  12 
%   behavior objects currently associated with handle H.
  13 
%
  14 
%   BH = HGGETBEHAVIOR(H,NAME) 
  15 
%   This syntax will return a behavior object of the given
  16 
%   NAME (NAME can be a string or cell array of strings). 
  17 
%   Behavior objects are lazy loaded (created on the fly) 
  18 
%   by this function. 
  19 
%
  20 
%   BH = HGGETBEHAVIOR(H,NAME,'-peek') 
  21 
%   The '-peek' flag by-passes lazy loading so that no behavior
  22 
%   objects are implicitly created. This syntax may return 
  23 
%   empty output if no behavior objects of the given type
  24 
%   are currently associted with this object.
  25 
%
  26 
%   Example 1:
  27 
%   % Prevent zooming on axes
  28 
%   ax = axes;
  29 
%   bh = hggetbehavior(ax,'Zoom');
  30 
%   bh.Enable = false; 
  31 
%   zoom on; % zoom should not work on this axes
  32 
%
  33 
%
  34 
%   Example 2: (place in MATLAB file)
  35 
%   % Customize data cursor string function for a line
  36 
%   h = line;
  37 
%   bh = hggetbehavior(h,'DataCursor');
  38 
%   bh.UpdateFcn = @myupdatefcn; 
  39 
%   
  40 
%   function [str] = myupdatefcn(hSource,hEvent)
  41 
%   % See DATACURSORMODE for full description of
  42 
%   % input arguments.
  43 
%   str = 'my string';
  44 
%
  45 
%   See also hgbehaviorfactory.
  46 

  47 
% Copyright 2003-2017 The MathWorks, Inc.
  48 

  49 

< 0.001 
     90 
  50
if nargin==0 
  51 
    % pretty print list of available behavior objects
  52 
    hgbehaviorfactory
  53 
    return;
< 0.001 
     90 
  54
end 
  55 

< 0.001 
     90 
  56
ret_h = []; 
  0.002 
     90 
  57
h = handle(h); 
  58 

< 0.001 
     90 
  59
if length(h)>1 
  60 
  error(message('MATLAB:hggetbehavior:ScalarHandleRequired'));
< 0.001 
     90 
  61
end 
  62 

< 0.001 
     90 
  63
if nargin==1 
  64 
    ret_h = get(h,'Behavior');
< 0.001 
     90 
  65
elseif nargin==3 
< 0.001 
     58 
  66
    behavior_name = lower(behavior_name); 
< 0.001 
     58 
  67
    if strcmp(flag,'-peek') 
  0.011 
     58 
  68
        ret_h = localPeek(h,behavior_name);      
< 0.001 
     58 
  69
    end 
< 0.001 
     32 
  70
elseif nargin==2 
< 0.001 
     32 
  71
    behavior_name = lower(behavior_name); 
  0.047 
     32 
  72
    ret_h = localGet(h,behavior_name); 
< 0.001 
     90 
  73
end 

Other subfunctions in this file are not included in this listing.