Mercurial > hg > ishara
comparison 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 |
comparison
equal
deleted
inserted
replaced
37:beb8a3f4a345 | 38:9d24b616bb06 |
---|---|
1 function g=ge(f,nout) | |
2 if nargin<2, nout=nargout(f); end | |
3 if nout<0, error('function must have a definite number of outputs'); end | |
4 if nargin(f)==1, g=@h1; else g=@hn; end | |
5 function rets=h1(x), [rets{1:nout}]=f(x); end | |
6 function rets=hn(varargin), [rets{1:nout}]=f(varargin{:}); end | |
7 end |