varargin
Specify that a function can take a variable number of arguments.
Syntax
function goo(a,varargin)
end
Inputs
- varargin
- Whatever can be assigned to a variable.
Example
function goo(a,varargin)
disp(a)
disp(varargin{1}) % it should print 2 here
end
goo(1,2,3);
1
2