function [u,v]=f(x,y) [lhs,rhs]=argn() if rhs <= 0 then error('at least one argument must be given');end if rhs <= 1 then y=2;end if lhs == 2 then u=x; v=y; else u=x+y; end endfunction [u,v]=f(4)