This is a static copy of a profile report

Home

imwrite>validateSizes (Calls: 10, Time: 0.001 s)
Generated 16-Jul-2020 17:09:39 using performance time.
subfunction in file /Applications/MATLAB_R2020a.app/toolbox/matlab/imagesci/imwrite.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
imwritefunction10
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
709
max32 = double(intmax('uint32'...
100.001 s43.1%
690
case {'uint8', 'int8', 'logica...
100.000 s19.3%
711
if (any(size(data) > max32)...
100.000 s3.5%
715
elseif ((numel(data) * element...
100.000 s2.3%
720
end
100.000 s1.0%
All other lines  0.000 s30.8%
Totals  0.001 s100% 
Children (called functions)
No children
Code Analyzer results
Line numberMessage
Coverage results
Show coverage for parent directory
Total lines in function35
Non-code lines (comments, blank lines)18
Code lines (lines that can run)17
Code lines that did run9
Code lines that did not run8
Coverage (did run/can run)52.94 %
Function listing
time 
Calls 
 line
 686 
function validateSizes(data)
 687 

 688 
% How many bytes does each element occupy in memory?
< 0.001 
     10 
 689
switch (class(data)) 
< 0.001 
     10 
 690
    case {'uint8', 'int8', 'logical'} 
 691 
        
< 0.001 
     10 
 692
        elementSize = 1; 
 693 
        
 694 
    case {'uint16', 'int16'}
 695 
        
 696 
        elementSize = 2;
 697 
        
 698 
    case {'uint32', 'int32', 'single'}
 699 
        
 700 
        elementSize = 4;
 701 
        
 702 
    case {'uint64', 'int64', 'double'}
 703 
        
 704 
        elementSize = 8;
 705 
        
< 0.001 
     10 
 706
end 
 707 

 708 
% Validate that the dataset/image will fit within 32-bit offsets.
< 0.001 
     10 
 709
max32 = double(intmax('uint32')); 
 710 

< 0.001 
     10 
 711
if (any(size(data) > max32)) 
 712 
    
 713 
    error(message('MATLAB:imagesci:imwrite:sideTooLong'))
 714 
    
< 0.001 
     10 
 715
elseif ((numel(data) * elementSize) > max32) 
 716 
    
 717 
    error(message('MATLAB:imagesci:imwrite:tooMuchData'))
 718 
    
< 0.001 
     10 
 719
end 
< 0.001 
     10 
 720
end 

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