This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
newplot>ObserveAxesNextPlotsubfunction5
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
50
clo(ax, extra{:});
50.022 s71.7%
47
claNotify(ax,extra{:});
50.005 s17.9%
24
[varargin{:}] = convertStrings...
50.001 s2.3%
29
(isgraphics(varargin{1},'axes'...
50.000 s1.2%
45
elseif isscalar(ax) &&...
50.000 s1.2%
All other lines  0.002 s5.7%
Totals  0.031 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
graphics/private/clofunction50.020 s66.2%
graphics/private/claNotifyfunction50.004 s12.4%
Self time (built-ins, overhead, etc.)  0.007 s21.3%
Totals  0.031 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function58
Non-code lines (comments, blank lines)34
Code lines (lines that can run)24
Code lines that did run16
Code lines that did not run8
Coverage (did run/can run)66.67 %
Function listing
time 
Calls 
 line
   1 
function ret_ax = cla(varargin)
   2 
%CLA Clear current axes.
   3 
%   CLA deletes all children of the current axes with visible handles and resets
   4 
%   the current axes ColorOrder and LineStyleOrder.
   5 
%
   6 
%   CLA RESET deletes all objects (including ones with hidden handles)
   7 
%   and also resets all axes properties, except Position and Units, to
   8 
%   their default values.
   9 
%
  10 
%   CLA(AX) or CLA(AX,'reset') clears the single axes with handle AX.
  11 
%
  12 
%   See also CLF, RESET, HOLD.
  13 

  14 
%   CLA(..., HSAVE) deletes all children except those specified in
  15 
%   HSAVE.
  16 

  17 
%   Copyright 1984-2020 The MathWorks, Inc.
  18 

  19 
% Check for an Axes handle.
  20 
% 'isgraphics' will catch numeric graphics handles, but will not catch
  21 
% deleted graphics handles, so we need to check for both separately.
  22 

< 0.001 
      5 
  23
if nargin > 0 
< 0.001 
      5 
  24
    [varargin{:}] = convertStringsToChars(varargin{:}); 
< 0.001 
      5 
  25
end 
  26 

< 0.001 
      5 
  27
if nargin > 0 && (... 
      5 
  28
        (isscalar(varargin{1}) && ... 
      5 
  29
        (isgraphics(varargin{1},'axes') || isgraphics(varargin{1},'polaraxes'))) ... 
  30 
        || isa(varargin{1},'matlab.graphics.axis.AbstractAxes'))
  31 
    % If first argument is an axes handle
< 0.001 
      5 
  32
    ax = varargin{1}; 
< 0.001 
      5 
  33
    extra = varargin(2:end); 
  34 
else
  35 
    % Default target is current axes
  36 
    ax = gca;
  37 
    extra = varargin;
< 0.001 
      5 
  38
end 
  39 

  40 
% Check to make sure we have a valid scalar axes handle.
  41 
% Empty array of axes handles is a no-op.
  42 
% Vector of axes or deleted axes is an error.
< 0.001 
      5 
  43
if isa(ax,'matlab.graphics.chart.Chart') 
  44 
    error(message('MATLAB:Chart:UnsupportedConvenienceFunction', 'cla', ax.Type));
< 0.001 
      5 
  45
elseif isscalar(ax) && isgraphics(ax)  
  46 
    % Call claNotify to trigger cla related evants.
  0.005 
      5 
  47
    claNotify(ax,extra{:}); 
  48 

  49 
    % Call clo on the axes
  0.022 
      5 
  50
    clo(ax, extra{:}); 
  51 
elseif ~isempty(ax)
  52 
    error(message('MATLAB:cla:InvalidAxesHandle'));
< 0.001 
      5 
  53
end 
  54 

  55 
% Return the axes handle if requested
< 0.001 
      5 
  56
if (nargout ~= 0) 
  57 
    ret_ax = ax;
< 0.001 
      5 
  58
end 

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