view general/funutils/bind1.m @ 26:8f4a21082c45

It was wrong. Now it is right.
author samer
date Sat, 19 Jan 2013 13:09:31 +0000
parents fbc0540a9208
children
line wrap: on
line source
% bind1 - Bind arguments to a function using Matlab closure
%
% bind1 :: 
%    func(A{1}, ..., A{N}->B{1:L})   ~'func from N inputs to L outputs',
%    A{1}, ..., A{M}                 ~'M<=N input arguments of the correct types'
% -> func(A{M+1}, ..., A{N}->B{1:L}) ~'func from remaining arguments to returns'.

function g=bind1(f,varargin)
	args=varargin;
	g=@(varargin)f(args{:},varargin{:});
end