Mercurial > hg > ishara
view general/funutils/doer.m @ 6:0ce3c2070089
Removed duplicate code and fixed doc in timed_action.
author | samer |
---|---|
date | Mon, 14 Jan 2013 14:33:37 +0000 |
parents | e44f49929e56 |
children |
line wrap: on
line source
function h=funseq(varargin) % funseq - Constructs sequential application of several functions % % h=funseq(f,...,g) % % returns the function h such that h(...) = g(...) but % all functions are evaluated in order. fns=varargin; h=@seq; function varargout=seq(varargin) for i=1:length(fns)-1 feval(fns{i},varargin{:}); end if nargout==0, feval(fns{end},varargin{:}); else [varargout{1:nargout}]=feval(fns{end},varargin{:}); end end end