This is a static copy of a profile report

Home

imshow>preParseInputs (1 call, 0.000 sec)
Generated 15-Mar-2007 12:02:00 using real time.
M-subfunction in file C:\Program Files\MATLAB71\toolbox\images\imuitools\imshow.m
[Copy to new window for comparing multiple runs]

Parents (calling functions)

Function NameFunction TypeCalls
imshowM-function1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
254
new_args = {};
10.000 s53.5%
321
msg1 = 'IMSHOW(x,y,...) is an ...
10.000 s23.9%
322
msg2 = 'Use IMSHOW(...,''XData...
10.000 s12.9%
255
num_args = nargin;
10.000 s7.8%
318
num_args = num_args - 2;
10.000 s1.8%
Other lines & overhead  0 s0%
Totals  0.000 s100% 
Children (called functions)
No children
M-Lint results
No M-Lint messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in file102
Non-code lines (comments, blank lines)51
Code lines (lines that can run)51
Code lines that did run20
Code lines that did not run31
Coverage (did run/can run)39.22 %
Function listing
   time   calls  line
239 function varargin_translated = preParseInputs(varargin)
240 % Catch old style syntaxes and warn
241
242 % Obsolete syntaxes:
243 % IMSHOW(I,N)
244 % N is ignored, gray(256) is always used for viewing grayscale images.
245 %
246 % IMSHOW(...,DISPLAY_OPTION)
247 % DISPLAY_OPTION is translated as follows:
248 % 'truesize' -> 'InitialMagnification', 100
249 % 'notruesize' -> 'InitialMagnification', 'fit'
250 %
251 % IMSHOW(x,y,A,...)
252 % x,y are translated to 'XData',x,'YData',y
253
< 0.01 1 254 new_args = {};
< 0.01 1 255 num_args = nargin;
256
1 257 if (num_args == 0)
258 eid = sprintf('Images:%s:tooFewArgs',mfilename);
259 error(eid,'%s\n%s','IMSHOW expected at least 1 input argument',...
260 'but was called instead with 0 input arguments.')
261 end
262
1 263 if (num_args > 1) && ischar(varargin{end})
264 % IMSHOW(...,DISPLAY_OPTION)
265
266 str = varargin{end};
267 strs = {'truesize', 'notruesize'};
268 try
269 % If trailing string is not 'truesize' or 'notruesize' jump to
270 % catch block and pass trailing string argument to regular input
271 % parsing so error will come from that parsing code.
272 option = iptcheckstrs(str, strs, mfilename,'DISPLAY_OPTION', nargin);
273
274 % Remove old argument
275 varargin(end) = [];
276 num_args = num_args - 1;
277
278 % Translate to InitialMagnification
279 new_args{1} = 'InitialMagnification';
280 if strncmp(option,'truesize',length(option))
281 new_args{2} = 100;
282 msg1 = 'IMSHOW(...,''truesize'') is an obsolete syntax. ';
283 msg2 = 'Use IMSHOW(...,''InitialMagnification'',100) instead.';
284
285 else
286 new_args{2} = 'fit';
287 msg1 = 'IMSHOW(...,''notruesize'') is an obsolete syntax. ';
288 msg2 = 'Use IMSHOW(...,''InitialMagnification'',''fit'') instead.';
289
290 end
291
292 wid = sprintf('Images:%s:obsoleteSyntaxDISPLAY_OPTION',mfilename);
293 warning(wid,'%s\n%s',msg1,msg2)
294 catch
295 % Trailing string did not match 'truesize' or 'notruesize' let regular
296 % parsing deal with it.
297
298 % Reset lasterr since we are ignoring the error from iptcheckstrs if
299 % a valid syntax was used.
300 lasterr('');
301 end
302 end
303
1 304 if (num_args==3 || num_args==4) && ...
305 isvector(varargin{1}) && isvector(varargin{2}) && ...
306 isnumeric(varargin{1}) && isnumeric(varargin{2})
307 % IMSHOW(x,y,...)
308
309 % Translate to IMSHOW(...,'XData',x,'YData',y)
1 310 p = length(new_args);
1 311 new_args{p+1} = 'XData';
1 312 new_args{p+2} = varargin{1};
1 313 new_args{p+3} = 'YData';
1 314 new_args{p+4} = varargin{2};
315
316 % Remove old arguments
1 317 varargin(1:2) = [];
< 0.01 1 318 num_args = num_args - 2;
319
1 320 wid = sprintf('Images:%s:obsoleteSyntaxXY',mfilename);
< 0.01 1 321 msg1 = 'IMSHOW(x,y,...) is an obsolete syntax. ';
< 0.01 1 322 msg2 = 'Use IMSHOW(...,''XData'',x,''YData'',y) instead.';
1 323 warning(wid,'%s%s',msg1,msg2)
1 324 end
325
1 326 if num_args == 2 && (numel(varargin{2}) == 1)
327 % IMSHOW(I,N)
328
329 wid = sprintf('Images:%s:obsoleteSyntaxN',mfilename);
330 msg1 = 'IMSHOW(I,N) is an obsolete syntax. Your grayscale ';
331 msg2 = 'image will be displayed using 256 shades of gray.';
332 warning(wid,'%s%s',msg1,msg2)
333
334 % Remove old argument
335 varargin(2) = [];
336 end
337
1 338 varargin_translated = {varargin{:}, new_args{:}};
339
1 340 end