To pass in a variable number of inputs to an existing function, use cell arrays with expansion, like this:
x = 1:10;
y = randn(size(x));
plotArguments = {'color' 'red' 'linestyle' '-'};
plot(x, y, plotArguments{:});
or
plotArguments = {1:10 randn(1,10) 'color' 'red' 'linestyle' '-'};
plot(plotArguments{:});
You can use the same trick to receive multiple numbers of outputs. The only hard part is remembering the correct notations.
numArgumentsToAccept = 2;
[results{1:numArgumentsToAccept }] = max(randn(100,1));