This is a static copy of a profile report

Home

imagesci/private/writepng>parseInputs (3 calls, 0.020 sec)
Generated 14-Nov-2016 07:47:23 using cpu time.
subfunction in file /usr/local/MATLAB/MATLAB_Production_Server/R2015a/toolbox/matlab/imagesci/private/writepng.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
imagesci/private/writepngfunction3
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
349
p.parse(varargin{:});
30.010 s50.0%
335
p.addParamValue('author',[],  ...
30.010 s50.0%
351
unmatched = p.Unmatched;
30 s0%
350
results = p.Results;
30 s0%
346
p.addParamValue('resolutionuni...
30 s0%
All other lines  0 s0%
Totals  0.020 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
...tes(x,{'char','double'},{'nonempty'})anonymous function30.010 s50.0%
...teattributes(x,{'char'},{'nonempty'})anonymous function300.010 s50.0%
...teattributes(x,{'double'},{'scalar'})anonymous function60 s0%
...teattributes(x,{'char'},{'nonempty'})anonymous function60 s0%
...alidateattributes(x,{'char'},{'row'})anonymous function30 s0%
...tes(x,{'char','double'},{'nonempty'})anonymous function60 s0%
...'row','numel',8,'>=',0,'<=',1})anonymous function30 s0%
...es(x,{'double'},{'scalar','>=',0})anonymous function30 s0%
...{'char','double'},{'row','nonempty'})anonymous function30 s0%
...{'size',[size(data,1),size(data,2)]})anonymous function30 s0%
...s(x,{'double'},{'>=',0,'<=',1})anonymous function30 s0%
...(x,{'double'},{'nonempty','>=',1})anonymous function30 s0%
...teattributes(x,{'double'},{'scalar'})anonymous function90 s0%
Self time (built-ins, overhead, etc.)  0 s0%
Totals  0.020 s100% 
Code Analyzer results
Line numberMessage
325'addParamValue' is not recommended. Use 'addParameter' instead.
326'addParamValue' is not recommended. Use 'addParameter' instead.
327'addParamValue' is not recommended. Use 'addParameter' instead.
328'addParamValue' is not recommended. Use 'addParameter' instead.
329'addParamValue' is not recommended. Use 'addParameter' instead.
330'addParamValue' is not recommended. Use 'addParameter' instead.
331'addParamValue' is not recommended. Use 'addParameter' instead.
332'addParamValue' is not recommended. Use 'addParameter' instead.
333'addParamValue' is not recommended. Use 'addParameter' instead.
334'addParamValue' is not recommended. Use 'addParameter' instead.
335'addParamValue' is not recommended. Use 'addParameter' instead.
336'addParamValue' is not recommended. Use 'addParameter' instead.
337'addParamValue' is not recommended. Use 'addParameter' instead.
338'addParamValue' is not recommended. Use 'addParameter' instead.
339'addParamValue' is not recommended. Use 'addParameter' instead.
340'addParamValue' is not recommended. Use 'addParameter' instead.
341'addParamValue' is not recommended. Use 'addParameter' instead.
342'addParamValue' is not recommended. Use 'addParameter' instead.
343'addParamValue' is not recommended. Use 'addParameter' instead.
344'addParamValue' is not recommended. Use 'addParameter' instead.
345'addParamValue' is not recommended. Use 'addParameter' instead.
346'addParamValue' is not recommended. Use 'addParameter' instead.
Coverage results
Show coverage for parent directory
Total lines in function65
Non-code lines (comments, blank lines)18
Code lines (lines that can run)47
Code lines that did run41
Code lines that did not run6
Coverage (did run/can run)87.23 %
Function listing
time 
calls 
 line
 287 
function [results, unmatched] = parseInputs(data,map,filename,varargin)
 288 

 289 
% Validate required arguments
      3 
 290 
validateattributes(data,{'double','single','logical','uint8','uint16'},{'nonempty'}); 
      3 
 291 
if isempty(map) 
      3 
 292 
    validateattributes(map,{'double'},{}); 
 293 
else
 294 
    validateattributes(map,{'double'},{'2d','ncols',3,'>=',0,'<=',1});
 295 
end
      3 
 296 
validateattributes(filename,{'char'},{'row','nonempty'}); 
 297 

      3 
 298 
propStrings = {'interlacetype', 'imagemodtime', ... 
 299 
    'transparency', 'bitdepth', 'significantbits', 'alpha', ...
 300 
    'background',   'gamma',    'xresolution',     'chromaticities', ...
 301 
    'yresolution',  'title',    'author',          'resolutionunit', ...
 302 
    'description',  'source',   'software',        'creationtime',  ...
 303 
    'disclaimer',   'warning',  'copyright',       'comment' };
 304 

 305 
% Process varargin into a form that we can use with the input parser.
      3 
 306 
for k = 1:2:length(varargin) 
     15 
 307 
    prop = lower(varargin{k}); 
     15 
 308 
    if (~ischar(prop)) 
 309 
        error(message('MATLAB:imagesci:writepng:parameterNotString'));
 310 
    end
 311 
    
     15 
 312 
    idx = find(strncmp(prop, propStrings, numel(prop))); 
     15 
 313 
    if (length(idx) > 1) 
 314 
        error(message('MATLAB:imagesci:validate:ambiguousParameterName', prop));
     15 
 315 
    elseif isscalar(idx) 
     15 
 316 
        varargin{k} = propStrings{idx}; 
     15 
 317 
    end 
     15 
 318 
end 
 319 

 320 
% Define the parser
      3 
 321 
p = inputParser; 
      3 
 322 
p.KeepUnmatched = true; 
 323 

 324 
% Add PV pairs to the input parser
      3 
 325 
p.addParamValue('bitdepth',[],       @(x)validateattributes(x,{'double'},{'scalar'})); 
      3 
 326 
p.addParamValue('significantbits',[],@(x)validateattributes(x,{'double'},{'nonempty','>=',1})); 
      3 
 327 
p.addParamValue('transparency',[],   @(x)validateattributes(x,{'double'},{'>=',0,'<=',1})); 
      3 
 328 
p.addParamValue('alpha',[],          @(x)validateattributes(x,{'double','uint8','uint16'},{'size',[size(data,1) size(data,2)]})); 
      3 
 329 
p.addParamValue('background',[],     @(x)validateattributes(x,{'char','double'},{'row','nonempty'})); 
      3 
 330 
p.addParamValue('gamma',[],          @(x)validateattributes(x,{'double'},{'scalar','>=',0})); 
      3 
 331 
p.addParamValue('chromaticities',[], @(x)validateattributes(x,{'double'},{'row','numel',8,'>=',0,'<=',1})); 
      3 
 332 
p.addParamValue('xresolution',[],    @(x)validateattributes(x,{'double'},{'scalar'})); 
      3 
 333 
p.addParamValue('yresolution',[],    @(x)validateattributes(x,{'double'},{'scalar'})); 
      3 
 334 
p.addParamValue('title',[],          @(x)validateattributes(x,{'char'},{'nonempty'})); 
  0.01 
      3 
 335 
p.addParamValue('author',[],         @(x)validateattributes(x,{'char'},{'nonempty'})); 
      3 
 336 
p.addParamValue('description',[],    @(x)validateattributes(x,{'char'},{'nonempty'})); 
      3 
 337 
p.addParamValue('copyright',[],      @(x)validateattributes(x,{'char'},{'nonempty'})); 
      3 
 338 
p.addParamValue('software',[],       @(x)validateattributes(x,{'char'},{'nonempty'})); 
      3 
 339 
p.addParamValue('disclaimer',[],     @(x)validateattributes(x,{'char'},{'nonempty'})); 
      3 
 340 
p.addParamValue('warning',[],        @(x)validateattributes(x,{'char'},{'nonempty'})); 
      3 
 341 
p.addParamValue('source',[],         @(x)validateattributes(x,{'char'},{'nonempty'})); 
      3 
 342 
p.addParamValue('comment',[],        @(x)validateattributes(x,{'char'},{'nonempty'})); 
      3 
 343 
p.addParamValue('creationtime',[],   @(x)validateattributes(x,{'char','double'},{'nonempty'})); 
      3 
 344 
p.addParamValue('imagemodtime',[],   @(x)validateattributes(x,{'char','double'},{'nonempty'})); 
      3 
 345 
p.addParamValue('interlacetype','none', @(x) validateattributes(x,{'char'},{'row'})); 
      3 
 346 
p.addParamValue('resolutionunit',[], @(x)validateattributes(x,{'char'},{'nonempty'})); 
 347 

 348 
% Parse remaining arguments and return results and unmatched
  0.01 
      3 
 349 
p.parse(varargin{:}); 
      3 
 350 
results = p.Results; 
      3 
 351 
unmatched = p.Unmatched; 

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