This is a static copy of a profile report

Home

padarray>ParseInputs (53999 calls, 17.324 sec)
Generated 05-Nov-2014 07:52:42 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/images/images/padarray.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
padarrayfunction53999
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
171
string = iptcheckstrs(varargin...
539995.087 s29.4%
145
iptcheckinput(padSize, {'doubl...
539991.582 s9.1%
134
iptchecknargin(2,4,nargin,mfil...
539991.402 s8.1%
161
iptcheckinput(padVal, {'numeri...
539991.061 s6.1%
158
if ~ischar(varargin{3})
539990.871 s5.0%
All other lines  7.320 s42.3%
Totals  17.324 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
iptcheckstrsfunction539994.026 s23.2%
iptcheckinputMEX-file1079980.781 s4.5%
iptchecknarginfunction539990.431 s2.5%
Self time (built-ins, overhead, etc.)  12.087 s69.8%
Totals  17.324 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function58
Non-code lines (comments, blank lines)24
Code lines (lines that can run)34
Code lines that did run25
Code lines that did not run9
Coverage (did run/can run)73.53 %
Function listing
   time   calls  line
132 function [a, method, padSize, padVal, direction] = ParseInputs(varargin)
133
1.40 53999 134 iptchecknargin(2,4,nargin,mfilename);
135
136 % fixed syntax args
0.44 53999 137 a = varargin{1};
0.39 53999 138 padSize = varargin{2};
139
140 % default values
0.16 53999 141 method = 'constant';
0.12 53999 142 padVal = 0;
0.20 53999 143 direction = 'both';
144
1.58 53999 145 iptcheckinput(padSize, {'double'}, {'real' 'vector' 'nonnan' 'nonnegative' ...
146 'integer'}, mfilename, 'PADSIZE', 2);
147
148 % Preprocess the padding size
0.31 53999 149 if (numel(padSize) < ndims(a))
150 padSize = padSize(:);
151 padSize(ndims(a)) = 0;
152 end
153
0.60 53999 154 if nargin > 2
155
0.22 53999 156 firstStringToProcess = 3;
157
0.87 53999 158 if ~ischar(varargin{3})
159 % Third input must be pad value.
0.34 53999 160 padVal = varargin{3};
1.06 53999 161 iptcheckinput(padVal, {'numeric' 'logical'}, {'scalar'}, ...
162 mfilename, 'PADVAL', 3);
163
0.35 53999 164 firstStringToProcess = 4;
165
0.21 53999 166 end
167
0.74 53999 168 for k = firstStringToProcess:nargin
0.38 53999 169 validStrings = {'circular' 'replicate' 'symmetric' 'pre' ...
170 'post' 'both'};
5.09 53999 171 string = iptcheckstrs(varargin{k}, validStrings, mfilename, ...
172 'METHOD or DIRECTION', k);
0.26 53999 173 switch string
0.21 53999 174 case {'circular' 'replicate' 'symmetric'}
175 method = string;
176
0.38 53999 177 case {'pre' 'post' 'both'}
0.29 53999 178 direction = string;
179
180 otherwise
181 error(message('images:padarray:unexpectedError'))
182 end
0.24 53999 183 end
0.27 53999 184 end
185
186 % Check the input array type
0.47 53999 187 if strcmp(method,'constant') && ~(isnumeric(a) || islogical(a))
188 error(message('images:padarray:badTypeForConstantPadding'))
189 end