This is a static copy of a profile report

Home

Function details for claThis is a static copy of a profile report

Home

cla (Calls: 2, Time: 0.011 s)
Generated 01-May-2020 20:23:08 using performance time.
function in file /Applications/MATLAB_R2018a.app/toolbox/matlab/graphics/cla.m
Copy to new window for comparing multiple runs

Parents (calling functions)

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

Line NumberCodeCallsTotal Time% TimeTime Plot
45
clo(ax, extra{:});
20.007 s62.4%
42
claNotify(ax,extra{:});
20.003 s22.1%
40
elseif isscalar(ax) &&...
20.000 s2.7%
24
(isgraphics(varargin{1},'axes'...
20.000 s2.6%
23
(isscalar(varargin{1}) &&a...
20.000 s2.6%
All other lines  0.001 s7.7%
Totals  0.011 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
graphics/private/clofunction20.006 s54.6%
graphics/private/claNotifyfunction20.002 s16.9%
Self time (built-ins, overhead, etc.)  0.003 s28.4%
Totals  0.011 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)32
Code lines (lines that can run)21
Code lines that did run11
Code lines that did not run10
Coverage (did run/can run)52.38 %
Function listing
time 
Calls 
 line
   1 
function ret_ax = cla(varargin)
   2 
%CLA Clear current axis.
   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-2016 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.
< 0.001 
      2 
  22
if nargin > 0 && (... 
      2 
  23
        (isscalar(varargin{1}) && ... 
      2 
  24
        (isgraphics(varargin{1},'axes') || isgraphics(varargin{1},'polaraxes'))) ... 
  25 
        || isa(varargin{1},'matlab.graphics.axis.AbstractAxes'))
  26 
    % If first argument is an axes handle
< 0.001 
      2 
  27
    ax = varargin{1}; 
< 0.001 
      2 
  28
    extra = varargin(2:end); 
  29 
else
  30 
    % Default target is current axes
  31 
    ax = gca;
  32 
    extra = varargin;
< 0.001 
      2 
  33
end 
  34 

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

  44 
    % Call clo on the axes
  0.007 
      2 
  45
    clo(ax, extra{:}); 
  46 
elseif ~isempty(ax)
  47 
    error(message('MATLAB:cla:InvalidAxesHandle'));
  48 
end
  49 

  50 
% Return the axes handle if requested
< 0.001 
      2 
  51
if (nargout ~= 0) 
  52 
    ret_ax = ax;
  53 
end

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