This is a static copy of a profile report

Home

graph3d/private/surfchk (Calls: 2, Time: 0.004 s)
Generated 16-Jul-2020 17:09:59 using performance time.
function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/graph3d/private/surfchk.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
surffunction2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
38
if (iscomplex(zmatrix) || isco...
20.001 s14.4%
51
(ym == 1 && yn ~= zm) ...
20.001 s14.2%
39
iscomplex(xmatrix) || iscomple...
20.000 s10.9%
16
msg = msg(zeros(0,1));
20.000 s9.7%
48
if ((xm == 1 && xn ~= ...
20.000 s8.0%
All other lines  0.002 s42.8%
Totals  0.004 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
graph3d/private/surfchk>iscomplexsubfunction80.001 s13.5%
Self time (built-ins, overhead, etc.)  0.004 s86.5%
Totals  0.004 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function60
Non-code lines (comments, blank lines)17
Code lines (lines that can run)43
Code lines that did run31
Code lines that did not run12
Coverage (did run/can run)72.09 %
Function listing
time 
Calls 
 line
   1 
function msg = surfchk(varargin)
   2 
%SURFCHK Check arguments to surf/mesh routines.
   3 
%   MSG = SURFCHK(Z), or
   4 
%   MSG = SURFCHK(Z,C), or
   5 
%   MSG = SURFCHK(X,Y,Z), or
   6 
%   MSG = SURFCHK(X,Y,Z,C) performs data validation on the inputs as if 
   7 
%   calling surf or mesh. An error message structure is returned if the
   8 
%   inputs are invalid.
   9 

  10 
%   Copyright 2006-2016 The MathWorks, Inc.
  11 

< 0.001 
      2 
  12
narginchk(0,4); 
  13 

< 0.001 
      2 
  14
msg.message = 0; 
< 0.001 
      2 
  15
msg.identifier = 0; 
< 0.001 
      2 
  16
msg = msg(zeros(0,1)); 
  17 

< 0.001 
      2 
  18
if nargin == 0 
  19 
    return;
< 0.001 
      2 
  20
end 
< 0.001 
      2 
  21
if nargin == 2 || nargin == 4 
  22 
    zmatrix = varargin{nargin-1};
  23 
    cmatrix = varargin{nargin};
< 0.001 
      2 
  24
else 
< 0.001 
      2 
  25
    zmatrix = varargin{nargin}; 
< 0.001 
      2 
  26
    cmatrix = zmatrix; 
< 0.001 
      2 
  27
end 
  28 

< 0.001 
      2 
  29
if nargin == 1 || nargin == 2 
  30 
    [zm,zn] = size(zmatrix);
  31 
    xmatrix = 1:zn;
  32 
    ymatrix = 1:zm;
< 0.001 
      2 
  33
else 
< 0.001 
      2 
  34
    xmatrix = varargin{1}; 
< 0.001 
      2 
  35
    ymatrix = varargin{2}; 
< 0.001 
      2 
  36
end 
  37 

  0.001 
      2 
  38
if (iscomplex(zmatrix) || iscomplex(cmatrix) || ... 
      2 
  39
    iscomplex(xmatrix) || iscomplex(ymatrix)) 
  40 
    msg = struct('message',getString(message('MATLAB:hg:surface:CannotBeComplex')),...
  41 
                 'identifier',id('ComplexData'));
< 0.001 
      2 
  42
end 
  43 

< 0.001 
      2 
  44
[xm,xn] = size(xmatrix); 
< 0.001 
      2 
  45
[ym,yn] = size(ymatrix); 
< 0.001 
      2 
  46
[zm,zn] = size(zmatrix); 
  47 

< 0.001 
      2 
  48
if ((xm == 1 && xn ~= zn) || ... 
      2 
  49
    (xn == 1 && xm ~= zn) || ... 
      2 
  50
    (xm ~= 1 && xn ~= 1 && (xm ~= zm || xn ~= zn)) || ... 
      2 
  51
    (ym == 1 && yn ~= zm) || ... 
      2 
  52
    (yn == 1 && ym ~= zm) || ... 
      2 
  53
    (ym ~= 1 && yn ~= 1 && (ym ~= zm || yn ~= zn))) 
  54 
    msg = struct('message',getString(message('MATLAB:hg:surface:InvalidDataDimensions')),...
  55 
                 'identifier',id('InvalidDataDimensions'));
< 0.001 
      2 
  56
end 
< 0.001 
      2 
  57
if (zm == 1 || zn == 1) 
  58 
    msg = struct('message',getString(message('MATLAB:hg:surface:MustBeMatrix')),...
  59 
                 'identifier',id('NonMatrixData'));
< 0.001 
      2 
  60
end 

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