Sounds like there are a variable number of inputs to this function. So your function can be used like:
mina = mymin(1,2,3,4,5);
minb = mymin(4.5,9,3);
If that is the case, then you want to use the varargin (variable arguments in) input variable in your function signature:
function minval = mymin(varargin)
The number of arguments in, nargin, is something you can use in your function body to indicate how many inputs have been passed to your function. Try the above and see what happens.
Best Answer