This is a static copy of a profile report

Home

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

Home

title (Calls: 2, Time: 0.024 s)
Generated 01-May-2020 20:23:09 using performance time.
function in file /Applications/MATLAB_R2018a.app/toolbox/matlab/graph2d/title.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
54
h = get(ax,'Title');
20.016 s67.5%
53
matlab.graphics.internal.markF...
20.002 s9.1%
18
[ax,args,nargs] = labelcheck('...
20.002 s8.8%
45
pvpairs = matlab.graphics.inte...
20.001 s3.9%
56
set(h, 'String', string, pvpai...
20.001 s3.1%
All other lines  0.002 s7.5%
Totals  0.024 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
markFigurefunction20.002 s7.5%
graph2d/private/labelcheckfunction20.001 s5.8%
convertStringToCharArgsfunction20.001 s2.7%
Self time (built-ins, overhead, etc.)  0.020 s84.0%
Totals  0.024 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function62
Non-code lines (comments, blank lines)33
Code lines (lines that can run)29
Code lines that did run17
Code lines that did not run12
Coverage (did run/can run)58.62 %
Function listing
time 
Calls 
 line
   1 
function hh = title(varargin)
   2 
%TITLE  Graph title.
   3 
%   TITLE('text') adds text at the top of the current axis.
   4 
%
   5 
%   TITLE('text','Property1',PropertyValue1,'Property2',PropertyValue2,...)
   6 
%   sets the values of the specified properties of the title.
   7 
%
   8 
%   TITLE(AX,...) adds the title to the specified axes.
   9 
%
  10 
%   H = TITLE(...) returns the handle to the text object used as the title.
  11 
%
  12 
%   See also XLABEL, YLABEL, ZLABEL, TEXT.
  13 

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

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

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

< 0.001 
      2 
  24
if isempty(ax) 
< 0.001 
      2 
  25
    ax = gca; 
  26 
  
  27 
    % Chart subclass support
  28 
    % Invoke title 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 = title(ax,args{:});
  33 
        else
  34 
            title(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 

  47 
%---Check for bypass option
< 0.001 
      2 
  48
if isappdata(ax,'MWBYPASS_title')        
  49 
   h = mwbypass(ax,'MWBYPASS_title',string,pvpairs{:});
  50 

  51 
%---Standard behavior      
< 0.001 
      2 
  52
else 
  0.002 
      2 
  53
   matlab.graphics.internal.markFigure(ax); 
  0.016 
      2 
  54
   h = get(ax,'Title'); 
  55 

< 0.001 
      2 
  56
   set(h, 'String', string, pvpairs{:}); 
  57 
      
< 0.001 
      2 
  58
end 
  59 

< 0.001 
      2 
  60
if nargout > 0 
  61 
  hh = h;
  62 
end

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