This is a static copy of a profile report

Home

iptcheckstrs (80055 calls, 5.938 sec)
Generated 05-Nov-2014 07:52:46 using cpu time.
function in file /usr1/opt/matlab/7.13/toolbox/images/iptutils/iptcheckstrs.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
padarray>ParseInputssubfunction53999
strel>ParseInputssubfunction1414
images/...te/morphop>ProcessOptionalArgssubfunction12524
imfill>parse_inputssubfunction12118
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
43
iptcheckinput(in, {'char'}, {'...
800551.472 s24.8%
47
num_matches = sum(matches);
800550.891 s15.0%
46
matches = strncmpi(in,valid_st...
800550.751 s12.6%
50
out = valid_strings{matches};
800550.741 s12.5%
49
if num_matches == 1
800550.441 s7.4%
All other lines  1.642 s27.7%
Totals  5.938 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
iptcheckinputMEX-file800550.481 s8.1%
Self time (built-ins, overhead, etc.)  5.458 s91.9%
Totals  5.938 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function75
Non-code lines (comments, blank lines)52
Code lines (lines that can run)23
Code lines that did run5
Code lines that did not run18
Coverage (did run/can run)21.74 %
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-2011 The MathWorks, Inc.
36 % $Revision: 1.1.8.5.2.1 $ $Date: 2011/07/18 00:39:21 $
37
38 % Except for IN, input arguments are not checked for validity.
39
40 % If you do not wish to specify argument position in resulting error
41 % messages, provide [] for ARG_POS.
42
1.47 80055 43 iptcheckinput(in, {'char'}, {'row'}, function_name, variable_name, ...
44 argument_position);
45
0.75 80055 46 matches = strncmpi(in,valid_strings,numel(in));
0.89 80055 47 num_matches = sum(matches);
48
0.44 80055 49 if num_matches == 1
0.74 80055 50 out = valid_strings{matches};
51
52 else
53 out = substringMatch(valid_strings(matches));
54
55 if isempty(out)
56 % Convert valid_strings to a single string containing a space-separated list
57 % of valid strings.
58 list = '';
59 for k = 1:length(valid_strings)
60 list = [list ', ' valid_strings{k}]; %#ok<AGROW>
61 end
62 list(1:2) = [];
63
64 if isempty(argument_position)
65 argument_position = 1;
66 end
67
68 if num_matches == 0
69 error(message('images:iptcheckstrs:unrecognizedStringChoice', upper( function_name ), iptnum2ordinal( argument_position ), variable_name, list, in))
70
71 else
72 error(message('images:iptcheckstrs:ambiguousStringChoice', upper( function_name ), iptnum2ordinal( argument_position ), variable_name, list, in))
73 end
74 end
75 end

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