This is a static copy of a profile report

Home

attributes>checkClass (Calls: 2, Time: 0.001 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
397
if isa(A,classes{i})
40.000 s26.1%
399
break;
20.000 s16.5%
396
for i = 1:num
20.000 s9.4%
400
elseif strcmp(classes{i}, 'num...
20.000 s8.9%
403
end
20.000 s8.8%
All other lines  0.000 s30.3%
Totals  0.001 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function30
Non-code lines (comments, blank lines)9
Code lines (lines that can run)21
Code lines that did run12
Code lines that did not run9
Coverage (did run/can run)57.14 %
Function listing
time 
Calls 
 line
 388 
function checkClass( A, classes, fname, msgId, argname, argpos )
 389 

 390 
% if A wasn't one of the classes, generate the appropriate error message 
 391 
% and throw the error
 392 

< 0.001 
      2 
 393
isAInClasses = false; 
< 0.001 
      2 
 394
num = numel(classes); 
 395 

< 0.001 
      2 
 396
for i = 1:num 
< 0.001 
      4 
 397
    if isa(A,classes{i}) 
< 0.001 
      2 
 398
        isAInClasses = true; 
< 0.001 
      2 
 399
        break; 
< 0.001 
      2 
 400
    elseif strcmp(classes{i}, 'numeric') 
 401 
        classes{i} = 'double, single, uint8, uint16, uint32, uint64, int8, int16, int32, int64';
< 0.001 
      2 
 402
    end 
< 0.001 
      2 
 403
end 
 404 

< 0.001 
      2 
 405
if ~isAInClasses 
 406 
    classesStr = sprintf( '%s, ', classes{:} );
 407 
    if ~isempty( classesStr )
 408 
        classesStr(end-1:end) = [];
 409 
    end
 410 

 411 
    argDes = matlab.internal.validators.getArgumentDescriptor( msgId, argname, argpos );
 412 
    error( matlab.internal.validators.generateId( fname, 'invalidType' ), '%s', ...
 413 
        getString(message( 'MATLAB:validateattributes:invalidType', ...
 414 
        argDes, classesStr, class(A) )));
< 0.001 
      2 
 415
end 
 416 

< 0.001 
      2 
 417
end 

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