Earlier today, usenet's grand fumblewit Christopher wrote:
> I like to use: > function foo = fx(arg1,arg2) > if ~exsit('arg1','var') > arg1 = 'default value'; > end > > that way if the user types: > foo = fx(,'bar'); %user intentionally omits first parameter in call to > fx. > > the program will assume arg1 as 'default value'. > > I don't like to check with varargs nargs etc, because this can force > particularities in parameter order when I don't want that (in general).
hmmm... I doubt my version of Matlab has a parameter named "exsit". Perhaps it's a hidden feature.