This is a static copy of a profile report

Home

xlabel (Calls: 12, Time: 0.267 s)
Generated 16-Jul-2020 17:08:46 using performance time.
function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/graph2d/xlabel.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
OC3function2
hhsave_VFI_3OCfunction10
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
65
h = get(ax,'XLabel');
120.240 s89.9%
19
isaxarr=matlab.graphics.chart....
120.007 s2.6%
71
'FontName',get(ax,'FontName'))...
120.006 s2.3%
27
[ax,args,nargs] = labelcheck('...
120.003 s1.1%
73
set(h, 'String', string, pvpai...
120.003 s1.0%
All other lines  0.008 s3.1%
Totals  0.267 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
...Manager>AxesLayoutManager.doUpdateclass method80.110 s41.1%
Legend.autoUpdateCallbackfunction80.045 s16.7%
...nteractions.createDefaultInteractionsclass method120.016 s6.1%
objArrayDispatchfunction120.005 s1.9%
Legend.Legend>Legend.getBackgroundColorclass method80.003 s1.1%
graph2d/private/labelcheckfunction120.002 s0.8%
...ractions.createAndRegisterTextControlclass method120.002 s0.8%
Legend.attachAxesListeners>safeMarkDirtynested function80.001 s0.4%
convertStringToCharArgsfunction120.001 s0.3%
...>@(obj,evd)(hObj.MarkDirty('all'))anonymous function80.001 s0.2%
Self time (built-ins, overhead, etc.)  0.082 s30.6%
Totals  0.267 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function79
Non-code lines (comments, blank lines)34
Code lines (lines that can run)45
Code lines that did run33
Code lines that did not run12
Coverage (did run/can run)73.33 %
Function listing
time 
Calls 
 line
   1 
function hh = xlabel(varargin)
   2 
%XLABEL X-axis label.
   3 
%   XLABEL('text') adds text beside the X-axis on the current axis.
   4 
%
   5 
%   XLABEL('text','Property1',PropertyValue1,'Property2',PropertyValue2,...)
   6 
%   sets the values of the specified properties of the xlabel.
   7 
%
   8 
%   XLABEL(AX,...) adds the xlabel to the specified axes.
   9 
%
  10 
%   H = XLABEL(...) returns the handle to the text object used as the label.
  11 
%
  12 
%   See also YLABEL, ZLABEL, TITLE, TEXT.
  13 

  14 
%   Copyright 1984-2019 The MathWorks, Inc.
  15 

< 0.001 
     12 
  16
if nargout>0 
  17 
    [isaxarr,hh]=matlab.graphics.chart.internal.objArrayDispatch(@xlabel,varargin{:});
< 0.001 
     12 
  18
else 
  0.007 
     12 
  19
    isaxarr=matlab.graphics.chart.internal.objArrayDispatch(@xlabel,varargin{:}); 
< 0.001 
     12 
  20
end 
< 0.001 
     12 
  21
if isaxarr 
  22 
    return
< 0.001 
     12 
  23
end 
  24 

  25 
% if the input has an xlabel property which is a text object, use it to set
  26 
% the xlabel on.
  0.003 
     12 
  27
[ax,args,nargs] = labelcheck('XLabel',varargin); 
  28 

< 0.001 
     12 
  29
if nargs == 0 || (nargs > 1 && (rem(nargs-1,2) ~= 0)) 
  30 
  error(message('MATLAB:xlabel:InvalidNumberOfInputs'))
< 0.001 
     12 
  31
end 
  32 

< 0.001 
     12 
  33
if isempty(ax) 
< 0.001 
     12 
  34
    ax = gca; 
  35 
    
  36 
    % Chart subclass support
  37 
    % Invoke xlabel method with same number of outputs to defer output arg
  38 
    % error handling to the method.
< 0.001 
     12 
  39
    if isa(ax,'matlab.graphics.chart.Chart') 
  40 
        if(nargout == 1)
  41 
            hh = xlabel(ax,args{:});
  42 
        else
  43 
            xlabel(ax,args{:});
  44 
        end
  45 
        return
< 0.001 
     12 
  46
    end 
< 0.001 
     12 
  47
end 
  48 

< 0.001 
     12 
  49
if isa(ax,'matlab.graphics.axis.GeographicAxes') 
  50 
   error(message('MATLAB:Chart:UnsupportedConvenienceFunction', 'xlabel', ax.Type)); 
< 0.001 
     12 
  51
end 
  52 

< 0.001 
     12 
  53
string = args{1}; 
< 0.001 
     12 
  54
if isempty(string), string=''; end 
< 0.001 
     12 
  55
pvpairs = args(2:end); 
  56 

  57 
% get-set does not support strings as of now
  0.002 
     12 
  58
pvpairs = matlab.graphics.internal.convertStringToCharArgs(pvpairs); 
  59 

< 0.001 
     12 
  60
if isappdata(ax,'MWBYPASS_xlabel') 
  61 
  h = mwbypass(ax,'MWBYPASS_xlabel',string,pvpairs{:});
  62 

  63 
  %---Standard behavior
< 0.001 
     12 
  64
else 
  0.240 
     12 
  65
    h = get(ax,'XLabel'); 
< 0.001 
     12 
  66
    if ~isa(ax,'matlab.graphics.layout.Layout') 
  0.007 
     12 
  67
        set(h,'FontSizeMode','auto',... 
  68 
            'FontUnitsMode','auto',...
     12 
  69
            'FontWeight',get(ax,'FontWeight'),... 
     12 
  70
            'FontAngle',get(ax,'FontAngle'),... 
     12 
  71
            'FontName',get(ax,'FontName')); 
< 0.001 
     12 
  72
    end 
  0.003 
     12 
  73
    set(h, 'String', string, pvpairs{:}); 
  74 
   
< 0.001 
     12 
  75
end 
  76 

< 0.001 
     12 
  77
if nargout > 0 
  78 
  hh = h;
< 0.001 
     12 
  79
end 

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