% rdivide - Bind arguments to a function using Matlab closure
%
% rdivide :: 
%    (A{1:N}=>B{:})
%    A{1}, ..., A{M}                 ~'M<=N input arguments of the correct types'
% -> (A{M+1:N}=>B{:}).

function g=rdivide(f,args)
	fns = { @q0, @q1, @(varargin)f(args{:},varargin{:}) };
	g=fns{1+acount(nargout(f),1)};
	function q0(varargin), f(args{:},varargin{:}); end
	function y=q1(varargin), y=f(args{:},varargin{:}); end
end

