ARGS is a MATLAB program which demonstrates command line argument retrieval.
In particular, ARGS is a demonstration of the NARGIN function, which counts command line arguments and the VARARGIN function, which allows the user to specify that a routine has a variable number of input arguments.
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
ARGS is available in a C version and a C++ version and a FORTRAN77 version and a FORTRAN90 version and a JAVA version and a MATLAB version.
You can go up one level to the MATLAB source codes.