This is a static copy of a profile reportHome
imwrite>validateSizes (40 calls, 0.022 sec)
Generated 05-Aug-2011 13:03:43 using cpu time.
subfunction in file /usr/local/MATLAB/R2011a/toolbox/matlab/imagesci/imwrite.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
imwrite | function | 40 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
626 | elementSize = 1; | 40 | 0.022 s | 100.0% |  |
655 | elseif ((numel(data) * element... | 40 | 0 s | 0% |  |
650 | if (any(size(data) > max32)... | 40 | 0 s | 0% |  |
648 | max32 = double(intmax('uint32'... | 40 | 0 s | 0% |  |
624 | case {'uint8', 'int8', 'logica... | 40 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0.022 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
intmax | function | 40 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.022 s | 100.0% |  |
Totals | | | 0.022 s | 100% | |
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 41 |
Non-code lines (comments, blank lines) | 23 |
Code lines (lines that can run) | 18 |
Code lines that did run | 6 |
Code lines that did not run | 12 |
Coverage (did run/can run) | 33.33 % |
Function listing
time calls line
620 function validateSizes(data)
621
622 % How many bytes does each element occupy in memory?
40 623 switch (class(data))
40 624 case {'uint8', 'int8', 'logical'}
625
0.02 40 626 elementSize = 1;
627
628 case {'uint16', 'int16'}
629
630 elementSize = 2;
631
632 case {'uint32', 'int32', 'single'}
633
634 elementSize = 4;
635
636 case {'uint64', 'int64', 'double'}
637
638 elementSize = 8;
639
640 otherwise
641
642 error('MATLAB:imwrite:unsupportedDatatype', ...
643 'Unsupported image datatype ''%s''.', class(data))
644
645 end
646
647 % Validate that the dataset/image will fit within 32-bit offsets.
40 648 max32 = double(intmax('uint32'));
649
40 650 if (any(size(data) > max32))
651
652 error('MATLAB:imwrite:sideTooLong', ...
653 'Images must have fewer than 2^32 - 1 elements on a side.')
654
40 655 elseif ((numel(data) * elementSize) > max32)
656
657 error('MATLAB:imwrite:tooMuchData', ...
658 'Images must contain fewer than 2^32 - 1 bytes of data.')
659
660 end
Other subfunctions in this file are not included in this listing.