This is a static copy of a profile report

Home

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

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
OC3function2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
52
h = get(ax,'XLabel');
20.008 s63.0%
57
'FontName',get(ax,'FontName'))...
20.001 s6.4%
58
set(h, 'String', string, pvpai...
20.001 s5.1%
18
[ax,args,nargs] = labelcheck('...
20.000 s3.7%
45
pvpairs = matlab.graphics.inte...
20.000 s3.3%
All other lines  0.002 s18.6%
Totals  0.012 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
graph2d/private/labelcheckfunction20.000 s0.6%
convertStringToCharArgsfunction20.000 s0.5%
Self time (built-ins, overhead, etc.)  0.012 s98.9%
Totals  0.012 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function64
Non-code lines (comments, blank lines)32
Code lines (lines that can run)32
Code lines that did run20
Code lines that did not run12
Coverage (did run/can run)62.50 %
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-2017 The MathWorks, Inc.
  15 

  16 
% if the input has an xlabel property which is a text object, use it to set
  17 
% the xlabel on.
< 0.001 
      2 
  18
[ax,args,nargs] = labelcheck('XLabel',varargin); 
  19 

< 0.001 
      2 
  20
if nargs == 0 || (nargs > 1 && (rem(nargs-1,2) ~= 0)) 
  21 
  error(message('MATLAB:xlabel:InvalidNumberOfInputs'))
  22 
end
  23 

< 0.001 
      2 
  24
if isempty(ax) 
< 0.001 
      2 
  25
    ax = gca; 
  26 
    
  27 
    % Chart subclass support
  28 
    % Invoke xlabel method with same number of outputs to defer output arg
  29 
    % error handling to the method.
< 0.001 
      2 
  30
    if isa(ax,'matlab.graphics.chart.Chart') 
  31 
        if(nargout == 1)
  32 
            hh = xlabel(ax,args{:});
  33 
        else
  34 
            xlabel(ax,args{:});
  35 
        end
  36 
        return
  37 
    end
< 0.001 
      2 
  38
end 
  39 

< 0.001 
      2 
  40
string = args{1}; 
< 0.001 
      2 
  41
if isempty(string), string=''; end 
< 0.001 
      2 
  42
pvpairs = args(2:end); 
  43 

  44 
% get-set does not support strings as of now
< 0.001 
      2 
  45
pvpairs = matlab.graphics.internal.convertStringToCharArgs(pvpairs); 
  46 

< 0.001 
      2 
  47
if isappdata(ax,'MWBYPASS_xlabel') 
  48 
  h = mwbypass(ax,'MWBYPASS_xlabel',string,pvpairs{:});
  49 

  50 
  %---Standard behavior
< 0.001 
      2 
  51
else 
  0.008 
      2 
  52
    h = get(ax,'XLabel'); 
  0.001 
      2 
  53
    set(h,'FontSizeMode','auto',... 
  54 
        'FontUnitsMode','auto',...
      2 
  55
        'FontWeight',get(ax,'FontWeight'),... 
      2 
  56
        'FontAngle',get(ax,'FontAngle'),... 
      2 
  57
        'FontName',get(ax,'FontName')); 
< 0.001 
      2 
  58
    set(h, 'String', string, pvpairs{:}); 
  59 
   
< 0.001 
      2 
  60
end 
  61 

< 0.001 
      2 
  62
if nargout > 0 
  63 
  hh = h;
  64 
end

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