Mercurial > hg > ishara
annotate general/funutils/@function_handle/ge.m @ 38:9d24b616bb06
Added function algebra.
author | samer |
---|---|
date | Tue, 29 Jan 2013 15:59:01 +0000 |
parents | |
children | c388f1c70669 |
rev | line source |
---|---|
samer@38 | 1 function g=ge(f,nout) |
samer@38 | 2 if nargin<2, nout=nargout(f); end |
samer@38 | 3 if nout<0, error('function must have a definite number of outputs'); end |
samer@38 | 4 if nargin(f)==1, g=@h1; else g=@hn; end |
samer@38 | 5 function rets=h1(x), [rets{1:nout}]=f(x); end |
samer@38 | 6 function rets=hn(varargin), [rets{1:nout}]=f(varargin{:}); end |
samer@38 | 7 end |