This is a static copy of a profile report

Home

islegendable (Calls: 62, Time: 0.090 s)
Generated 16-Jul-2020 17:08:55 using performance time.
function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/graphics/illustration/+matlab/+graphics/+illustration/+internal/islegendable.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
getLegendableChildrenfunction8
Legend.autoUpdateCallbackfunction54
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
16
~strcmpi(h.Annotation.LegendIn...
4340.028 s30.7%
15
strcmpi(h.LegendDisplay,'on') ...
4340.018 s19.7%
17
hasbehavior(h,'legend')
4340.016 s18.1%
22
if res(i) && isa(h,'ma...
4340.008 s9.2%
14
strcmp(h.HandleVisibility,'on'...
4340.008 s8.9%
All other lines  0.012 s13.5%
Totals  0.090 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
hasbehaviorfunction4340.014 s15.3%
Self time (built-ins, overhead, etc.)  0.076 s84.7%
Totals  0.090 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function28
Non-code lines (comments, blank lines)11
Code lines (lines that can run)17
Code lines that did run14
Code lines that did not run3
Coverage (did run/can run)82.35 %
Function listing
time 
Calls 
 line
   1 
function res=islegendable(in_array)
   2 
%ISLEGENDABLE Tests if an object can be in a legend
   3 
%    RES = ISLEGENDABLE(H) returns true if graphics object H can
   4 
%    be shown in a legend.
   5 

   6 
%   Copyright 1984-2014 The MathWorks, Inc.
   7 

< 0.001 
     62 
   8
res = false(1,numel(in_array)); 
   9 

< 0.001 
     62 
  10
for i = 1:numel(in_array) 
  0.005 
    434 
  11
    h = in_array(i); 
  0.074 
    434 
  12
    if isa(h,'matlab.graphics.mixin.Legendable') && ... 
    434 
  13
       isvalid(h) && ... 
    434 
  14
       strcmp(h.HandleVisibility,'on') && ... 
    434 
  15
       strcmpi(h.LegendDisplay,'on') && ... 
    434 
  16
       ~strcmpi(h.Annotation.LegendInformation.IconDisplayStyle,'off') && ... 
    434 
  17
       hasbehavior(h,'legend') 
  18 

< 0.001 
    434 
  19
        res(i) = true; 
  20 

  21 
        % if HGGroup, must have children
  0.008 
    434 
  22
        if res(i) && isa(h,'matlab.graphics.primitive.Group') 
  23 
            if isempty(h.Children')
  24 
                res(i) = false;
  25 
            end
< 0.001 
    434 
  26
        end 
< 0.001 
    434 
  27
    end 
< 0.001 
    434 
  28
end 

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