VARARGIN VARARGIN Variable Input Arguments Usage FreeMat functions can take a variable number of input arguments by setting the last argument in the argument list to varargin. This special keyword indicates that all arguments to the function (beyond the last non-varargin keyword) are assigned to a cell array named varargin available to the function. Variable argument functions are usually used when writing driver functions, i.e., functions that need to pass arguments to another function. The general syntax for a function that takes a variable number of arguments is function [out_1,...,out_M] = fname(in_1,..,in_M,varargin) Inside the function body, varargin collects the arguments to fname that are not assigned to the in_k.