%% varargin and Declared Inputs
% Define a function in a file named definedAndVariableNumInputs.m that expects two inputs and accepts an additional number of inputs.

type definedAndVariableNumInputs

% Call the function with several inputs.

definedAndVariableNumInputs(7,pi,rand(4),datetime('now'),'hello')

% Call the function with two inputs. varargin is an empty cell array.

definedAndVariableNumInputs(13,42)

% Copyright 2012 The MathWorks, Inc.