This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
imwritefunction3
Lines where the most time was spent
No measurable time spent in this function

Line NumberCodeCallsTotal Time% TimeTime Plot
565
end
150 s0%
564
validateattributes(paramPairs{...
150 s0%
563
for k = 1:2:length(paramPairs)
30 s0%
561
end
30 s0%
557
if (rem(length(paramPairs), 2)...
30 s0%
All other lines  0 s0%
Totals  0 s0% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
imformatsfunction30 s0%
Self time (built-ins, overhead, etc.)  0 s0%
Totals  0 s0% 
Code Analyzer results
Line numberMessage
490The value assigned to variable 'data' might be unused.
492The value assigned to variable 'filename' might be unused.
Coverage results
Show coverage for parent directory
Total lines in function79
Non-code lines (comments, blank lines)26
Code lines (lines that can run)53
Code lines that did run29
Code lines that did not run24
Coverage (did run/can run)54.72 %
Function listing
time 
calls 
 line
 487 
function [data, map, filename, format, paramPairs] = parse_inputs(varargin)
 488 

 489 

      3 
 490 
data = []; 
      3 
 491 
map = []; 
      3 
 492 
filename = ''; 
      3 
 493 
format = ''; 
      3 
 494 
paramPairs = {}; 
 495 

 496 

      3 
 497 
if (nargin < 2) 
 498 
	error(message('MATLAB:imagesci:validate:wrongNumberOfInputs'));
 499 
end
 500 

      3 
 501 
firstString = []; 
      3 
 502 
for k = 1:length(varargin) 
      6 
 503 
    if (ischar(varargin{k})) 
      3 
 504 
        firstString = k; 
      3 
 505 
        break; 
 506 
    end
      3 
 507 
end 
 508 

      3 
 509 
if (isempty(firstString)) 
 510 
	error(message('MATLAB:imagesci:imwrite:missingFilename'));
 511 
end
 512 

      3 
 513 
switch firstString 
      3 
 514 
case 1 
 515 
	error(message('MATLAB:imagesci:imwrite:firstArgString'));
 516 
    
      3 
 517 
case 2 
 518 
    % imwrite(data, filename, ...)
      3 
 519 
    data = varargin{1}; 
      3 
 520 
    filename = varargin{2}; 
 521 
    
 522 
case 3
 523 
    % imwrite(data, map, filename, ...)
 524 
    data = varargin{1};
 525 
    map = varargin{2};
 526 
    filename = varargin{3};
 527 
    if (size(map,2) ~= 3)
 528 
		error(message('MATLAB:imagesci:imwrite:invalidColormap'));
 529 
    end
 530 
    
 531 
    validateattributes(map,{'numeric'},{'>=',0,'<=',1},'','COLORMAP');
 532 

 533 
otherwise
 534 
    error(message('MATLAB:imagesci:imwrite:badFilenameArgumentPosition'));
 535 
end
 536 

      3 
 537 
if (length(varargin) > firstString) 
 538 
    % There are additional arguments after the filename.
      3 
 539 
    if (~ischar(varargin{firstString + 1})) 
 540 
    	error(message('MATLAB:imagesci:imwrite:invalidArguments'));
 541 
    end
 542 
    
 543 
    % Is the argument after the filename a format specifier?
      3 
 544 
    fmt_s = imformats(varargin{firstString + 1}); 
 545 
    
      3 
 546 
    if (~isempty(fmt_s)) 
 547 
        % imwrite(..., filename, fmt, ...)
      3 
 548 
        format = varargin{firstString + 1}; 
      3 
 549 
        paramPairs = varargin((firstString + 2):end); 
 550 
        
 551 
    else
 552 
        % imwrite(..., filename, prop1, val1, prop2, val2, ...)
 553 
        paramPairs = varargin((firstString + 1):end);
 554 
    end
 555 
    
 556 
    % Do some validity checking on param-value pairs
      3 
 557 
    if (rem(length(paramPairs), 2) ~= 0) 
 558 
    	error(message('MATLAB:imagesci:imwrite:invalidSyntaxOrFormat',varargin{firstString + 1}));
 559 
    end
 560 

      3 
 561 
end 
 562 

      3 
 563 
for k = 1:2:length(paramPairs) 
     15 
 564 
    validateattributes(paramPairs{k},{'char'},{'nonempty'},'','PARAMETER NAME'); 
     15 
 565 
end 

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