%% Add Optional Input
% Create an inputParser object and add an optional input to the input parser scheme.  Name the argument myinput, and assign it a default value of 13.

p = inputParser;
argName = 'myInput';
defaultVal = 13;
addOptional(p,argName,defaultVal)

% Call the parse function with no inputs, and display the results.

parse(p)
p.Results

% Call the parse function with an input value of 42, and display the results.

parse(p,42)
p.Results

% Copyright 2015 The MathWorks, Inc.