This is a static copy of a profile reportHome
imformats>find_in_registry (12977 calls, 6.299 sec)
Generated 05-Nov-2014 07:52:35 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/matlab/imagesci/imformats.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
imformats | function | 12977 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
521 | match(p) = any(strcmp(key, in(... | 246563 | 3.505 s | 55.6% |  |
522 | end | 246563 | 1.112 s | 17.6% |  |
519 | match = false(1,length(in)); | 12977 | 0.300 s | 4.8% |  |
531 | out = in(match); | 12977 | 0.280 s | 4.5% |  |
520 | for p = 1:length(in) | 12977 | 0.240 s | 3.8% |  |
All other lines | | | 0.861 s | 13.7% |  |
Totals | | | 6.299 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
Line number | Message |
521 | Use STRCMPI(str1,str2) instead of using UPPER/LOWER in a call to STRCMP. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 26 |
Non-code lines (comments, blank lines) | 12 |
Code lines (lines that can run) | 14 |
Code lines that did run | 11 |
Code lines that did not run | 3 |
Coverage (did run/can run) | 78.57 % |
Function listing
time calls line
507 function [out, match] = find_in_registry(in, key)
508 %FIND_IN_REGISTRY Find a particular format given
509
510 % Verify that key is a single, 1-D character array
0.07 12977 511 if ((~ischar(key)) || (isempty(key)) || (size(key, 2) ~= numel(key)))
512 error(message('MATLAB:imagesci:imformats:formatNotCharVector'))
513 end
514
515 % Convert key to lowercase
0.09 12977 516 key = lower(key);
517
518 % Look for the input format in the formats registry
0.30 12977 519 match = false(1,length(in));
0.24 12977 520 for p = 1:length(in)
3.50 246563 521 match(p) = any(strcmp(key, in(p).ext));
1.11 246563 522 end
523
524 % Check whether the format was found
0.21 12977 525 switch (sum(match))
0.05 12977 526 case 0
527 % Not found.
528 out = struct([]);
0.03 12977 529 case 1
530 % One match found.
0.28 12977 531 out = in(match);
0.15 12977 532 end
Other subfunctions in this file are not included in this listing.