This is a static copy of a profile report

Home

objArrayDispatch (Calls: 5, Time: 0.004 s)
Generated 18-May-2021 16:05:23 using performance time.
function in file /usr/local/MATLAB/R2021a/toolbox/matlab/graphics/chart/+matlab/+graphics/+chart/+internal/objArrayDispatch.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
titlefunction5
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
7
outarr=gobjects;
50.002 s40.3%
18
if isempty(args) || isempty(ar...
50.002 s40.2%
19
return
50.000 s6.9%
10
isAllowed=@(obj)isa(obj,'matla...
50.000 s4.4%
9
args=varargin;
50.000 s1.2%
All other lines  0.000 s7.0%
Totals  0.004 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
gobjectsfunction50.001 s26.9%
...tlab.graphics.illustration.ColorBar')anonymous function260.000 s12.4%
Self time (built-ins, overhead, etc.)  0.002 s60.7%
Totals  0.004 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function53
Non-code lines (comments, blank lines)20
Code lines (lines that can run)33
Code lines that did run6
Code lines that did not run27
Coverage (did run/can run)18.18 %
Function listing
time 
Calls 
 line
   1 
function [isaxarray,outarr]=objArrayDispatch(func,varargin)
   2 
% This function is undocumented and may change in a future release.
   3 

   4 
% Dispatches a function to multiple axes
   5 
%   Copyright 2019-2020 The MathWorks, Inc.
   6 

  0.002 
      5 
   7
    outarr=gobjects; 
< 0.001 
      5 
   8
    isaxarray=false; 
< 0.001 
      5 
   9
    args=varargin; 
< 0.001 
      5 
  10
    isAllowed=@(obj)isa(obj,'matlab.graphics.axis.AbstractAxes') || ... 
  11 
                    isa(obj,'matlab.graphics.chart.Chart') || ...
  12 
                    isa(obj,'matlab.graphics.layout.Layout') || ...
  13 
                    isa(obj,'matlab.graphics.illustration.Legend') || ...
  14 
                    isa(obj,'matlab.graphics.illustration.ColorBar');
  15 

  16 
    % Return if args/first arg is empty, or first arg is scalar or the first
  17 
    % arg contains anything other than an axes/chart
  0.002 
      5 
  18
    if isempty(args) || isempty(args{1}) || isscalar(args{1}) || ~any(arrayfun(isAllowed,args{1}),'all') 
< 0.001 
      5 
  19
        return 
  20 
    end
  21 

  22 
    % Peel off axes array
  23 
    axarr=args{1};
  24 
    args(1)=[];
  25 
    isaxarray=true;
  26 
    
  27 
    % Error for heterogeneous arrays
  28 
    isHomogeneous=all(arrayfun(@(x)strcmp(class(x),class(axarr)),axarr), 'all');
  29 
    if ~isHomogeneous
  30 
        throwAsCaller(MException(message('MATLAB:rulerFunctions:MixedAxesVector')))
  31 
    end
  32 
        
  33 
    % Loop over axarr
  34 
    if nargout>1
  35 
        % the calling function has an output
  36 
        outarr=gobjects(size(axarr));
  37 
        for i = 1:numel(axarr)
  38 
            try
  39 
                outarr(i)=func(axarr(i),args{:});
  40 
            catch me
  41 
                throwAsCaller(me)
  42 
            end
  43 
        end
  44 
    else
  45 
        for i = 1:numel(axarr)
  46 
            try
  47 
                func(axarr(i),args{:});
  48 
            catch me
  49 
                throwAsCaller(me)
  50 
            end
  51 
        end
  52 
    end
  53 
end

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