This is a static copy of a profile reportHome
iptcheckstrs (2 calls, 0.000 sec)
Generated 15-Mar-2007 12:02:01 using real time.
M-function in file C:\Program Files\MATLAB71\toolbox\images\iptutils\iptcheckstrs.m
[Copy to new window for comparing multiple runs]
Parents (calling functions)
Lines where the most time was spent
No measurable time spent in this functionLine Number | Code | Calls | Total Time | % Time | Time Plot |
47 | out = valid_strings{matches}; | 2 | 0 s | 0% |  |
46 | if num_matches == 1 | 2 | 0 s | 0% |  |
44 | num_matches = sum(matches); | 2 | 0 s | 0% |  |
43 | matches = strncmpi(in,valid_st... | 2 | 0 s | 0% |  |
40 | iptcheckinput(in, {'char'}, {'... | 2 | 0 s | 0% |  |
Other lines & overhead | | | 0 s | 0% |  |
Totals | | | 0.000 s | 0% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
iptcheckinput | MEX-function | 2 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0 s | 0% |  |
Totals | | | 0.000 s | 0% | |
M-Lint results
Coverage results
[ Show coverage for parent directory ]
Total lines in file | 81 |
Non-code lines (comments, blank lines) | 54 |
Code lines (lines that can run) | 27 |
Code lines that did run | 5 |
Code lines that did not run | 22 |
Coverage (did run/can run) | 18.52 % |
Function listing
time calls line
1 function out = iptcheckstrs(in, valid_strings, function_name, ...
2 variable_name, argument_position)
3 %IPTCHECKSTRS Check validity of text string.
4 % OUT = IPTCHECKSTRS(IN,VALID_STRINGS,FUNC_NAME,VAR_NAME,ARG_POS) checks
5 % the validity of the text string IN. If the text string matches one of
6 % the text strings in the cell array VALID_STRINGS, IPTCHECKSTRS returns
7 % the valid text string in OUT. If the text string does not match,
8 % IPTCHECKSTRS issues a formatted error message.
9 %
10 % IPTCHECKSTRS looks for a case-insensitive nonambiguous match between
11 % IN and the strings in VALID_STRINGS.
12 %
13 % VALID_STRINGS is a cell array containing text strings.
14 %
15 % FUNC_NAME is a string that specifies the name used in the formatted
16 % error message to identify the function checking text strings.
17 %
18 % VAR_NAME is a string that specifies the name used in the formatted
19 % error message to identify the argument being checked.
20 %
21 % ARG_POS is a positive integer that indicates the position of
22 % the argument being checked in the function argument list.
23 % IPTCHECKSTRS converts this number to an ordinal number and includes
24 % this information in the formatted error message.
25 %
26 % Example
27 % -------
28 % % To trigger this error message, define a cell array of some text
29 % % strings and pass in another string that isn't in the cell array.
30 % iptcheckstrs('option3',{'option1','option2'},'func_name','var_name',2)
31 %
32 % See also IPTCHECKHANDLE, IPTCHECKINPUT, IPTCHECKMAP, IPTCHECKNARGIN
33 % IPTNUM2ORDINAL.
34
35 % Copyright 1993-2004 The MathWorks, Inc.
36 % $Revision: 1.1.8.1 $ $Date: 2004/08/10 01:50:51 $
37
38 % Except for IN, input arguments are not checked for validity.
39
2 40 iptcheckinput(in, {'char'}, {'row'}, function_name, variable_name, ...
41 argument_position);
42
2 43 matches = strncmpi(in,valid_strings,numel(in));
2 44 num_matches = sum(matches);
45
2 46 if num_matches == 1
2 47 out = valid_strings{matches};
48
49 else
50 out = substringMatch(valid_strings(matches));
51
52 if isempty(out)
53 % Convert valid_strings to a single string containing a space-separated list
54 % of valid strings.
55 list = '';
56 for k = 1:length(valid_strings)
57 list = [list ', ' valid_strings{k}];
58 end
59 list(1:2) = [];
60
61 msg1 = sprintf('Function %s expected its %s input argument, %s,', ...
62 upper(function_name), iptnum2ordinal(argument_position), ...
63 variable_name);
64 msg2 = 'to match one of these strings:';
65
66 if num_matches == 0
67 msg3 = sprintf('The input, ''%s'', did not match any of ', in);
68 msg4 = 'the valid strings.';
69 id = sprintf('Images:%s:unrecognizedStringChoice', function_name);
70
71 else
72 msg3 = sprintf('The input, ''%s'', matched more than one ', in);
73 msg4 = 'valid string.';
74 id = sprintf('Images:%s:ambiguousStringChoice', function_name);
75 end
76
77 error(id,'%s\n%s\n\n %s\n\n%s%s', msg1, msg2, list, msg3,msg4);
78 end
79 end
80
81 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Other subfunctions in this file are not included in this listing.