This is a static copy of a profile report

Home

attributes>checkAttrs (Calls: 2, Time: 0.004 s)
Generated 04-Jun-2021 04:11:07 using performance time.
subfunction in file C:\Program Files\MATLAB\R2020b\toolbox\matlab\lang\+matlab\+internal\+validators\attributes.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
attributesfunction2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
76
attributor(A, fname, msgId, ar...
20.002 s39.4%
59
attributor = findSupportedAttr...
20.001 s31.6%
51
elseif (ischar(attrs{i}) || is...
20.000 s4.4%
57
attr = attrs{idx};
20.000 s3.1%
89
end
20.000 s2.6%
All other lines  0.001 s18.8%
Totals  0.004 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
...ctedScalartext',msgId,argname,argpos)anonymous function20.001 s31.5%
attributes>findSupportedAttrsubfunction20.001 s19.0%
Self time (built-ins, overhead, etc.)  0.002 s49.5%
Totals  0.004 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function55
Non-code lines (comments, blank lines)16
Code lines (lines that can run)39
Code lines that did run21
Code lines that did not run18
Coverage (did run/can run)53.85 %
Function listing
time 
Calls 
 line
  37 
function checkAttrs( A, attrs, fname, msgId, argname, argpos )
  38 

< 0.001 
      2 
  39
warnOnUnknownAttr = true; 
< 0.001 
      2 
  40
numAttrs = length(attrs); 
< 0.001 
      2 
  41
idx = 1; 
< 0.001 
      2 
  42
isAttributeScalar = false; 
  43 

  44 
% isAttributeScalar is logical true when 'scalar' is one of the attributes
  45 
% provided by the user
  46 

< 0.001 
      2 
  47
for i=1:numAttrs 
  48 
    
< 0.001 
      2 
  49
    if isstring(attrs{i}) && ismissing(attrs{i}) 
  50 
        error(message('MATLAB:validateattributes:missingValueInAttributeList'))
< 0.001 
      2 
  51
    elseif (ischar(attrs{i}) || isstring(attrs{i})) && strcmp(attrs{i},'scalar') 
  52 
        isAttributeScalar = true;
< 0.001 
      2 
  53
    end 
< 0.001 
      2 
  54
end 
  55 

< 0.001 
      2 
  56
while idx <= numAttrs 
< 0.001 
      2 
  57
    attr = attrs{idx}; 
  58 
    
  0.001 
      2 
  59
    attributor = findSupportedAttr( attr, isAttributeScalar);  
< 0.001 
      2 
  60
    if isempty(attributor)  
  61 
        % only warn once if the attribute wasn't found in the supported list
  62 
        if warnOnUnknownAttr
  63 
            if ischar( attr ) || isstring( attr )
  64 
                warning(message('MATLAB:validateattributes:attributeNotFound', char(attr) ))
  65 
            else
  66 
                warning(message('MATLAB:validateattributes:attributeBadClass', class(attr)))
  67 
            end
  68 
            warnOnUnknownAttr = false;
  69 
        end
  70 
        idx = idx + 1;
  71 
        continue
< 0.001 
      2 
  72
    end 
  73 
    
< 0.001 
      2 
  74
    switch nargin( attributor ) 
< 0.001 
      2 
  75
        case 5 
  0.002 
      2 
  76
            attributor(A, fname, msgId, argname, argpos) 
< 0.001 
      2 
  77
            idx = idx + 1; 
  78 
            
  79 
        case 6
  80 
            if idx == numel(attrs)
  81 
                error(message('MATLAB:validateattributes:notEnoughArguments', attr))
  82 
            end
  83 
            
  84 
            attributor(A, attrs{idx+1}, fname, msgId, argname, argpos )
  85 
            idx = idx + 2;
  86 
            
< 0.001 
      2 
  87
    end 
  88 
    
< 0.001 
      2 
  89
end 
  90 
 
< 0.001 
      2 
  91
end 

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