time | Calls | line |
---|
| | 519 | function [out, match] = find_in_registry(in, key)
|
| | 520 | %FIND_IN_REGISTRY Find a particular format given
|
| | 521 |
|
< 0.001 | 20 | 522 | validateattributes(key,{'char', 'string'},{'nonempty','scalartext'},'','KEY');
|
| | 523 |
|
| | 524 |
|
| | 525 | % Look for the input format in the formats registry
|
< 0.001 | 20 | 526 | match = false(1,length(in));
|
< 0.001 | 20 | 527 | for p = 1:length(in)
|
0.002 | 380 | 528 | match(p) = any(strcmpi(key, in(p).ext));
|
< 0.001 | 380 | 529 | end
|
| | 530 |
|
| | 531 | % Check whether the format was found
|
< 0.001 | 20 | 532 | switch (sum(match))
|
< 0.001 | 20 | 533 | case 0
|
| | 534 | % Not found.
|
| | 535 | out = struct([]);
|
< 0.001 | 20 | 536 | case 1
|
| | 537 | % One match found.
|
< 0.001 | 20 | 538 | out = in(match);
|
< 0.001 | 20 | 539 | end
|
Other subfunctions in this file are not included in this listing.