This is a static copy of a profile report

Home

objArrayDispatch (Calls: 94, Time: 0.021 s)
Generated 16-Jul-2020 17:08:40 using performance time.
function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/graphics/chart/+matlab/+graphics/+chart/+internal/objArrayDispatch.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
xlabelfunction12
ylabelfunction12
gridfunction2
titlefunction10
zlabelfunction2
holdfunction56
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
19
if isempty(args) || isempty(ar...
940.009 s44.2%
7
outarr=gobjects;
940.008 s37.0%
20
return
940.001 s6.4%
10
isAllowed=@(obj)isa(obj,'matla...
940.001 s4.4%
9
args=varargin;
940.000 s1.2%
All other lines  0.001 s6.8%
Totals  0.021 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
gobjectsfunction940.006 s30.2%
...||isa(obj,'matlab.ui.control.UIAxes')anonymous function5330.001 s5.8%
Self time (built-ins, overhead, etc.)  0.013 s64.1%
Totals  0.021 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function54
Non-code lines (comments, blank lines)21
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 The MathWorks, Inc.
   6 

  0.008 
     94 
   7
    outarr=gobjects; 
< 0.001 
     94 
   8
    isaxarray=false; 
< 0.001 
     94 
   9
    args=varargin; 
< 0.001 
     94 
  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 
                    isa(obj,'matlab.ui.control.UIAxes');
  16 

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

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

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