function varargout = argdeal(varargin) %ARGDEAL like DEAL for multiple arguments, but is prepared to throw some away % % The function is just: varargout = varargin(1:max(1,nargout)); % This makes argdeal useful in creating inline functions that % behave like normal Matlab functions: % fn = @(x) argdeal(fn1(x), fn2(x)); % y = fn(2); % would have thrown error if had used deal() % Iain Murray, February 2008 varargout = varargin(1:max(1,nargout));