Mercurial > hg > ishara
view general/funutils/returns.m @ 13:03694e5c8365
Reorganised some high order list functions to correct class-based method dispatch; fixed some docs.
author | samer |
---|---|
date | Wed, 16 Jan 2013 12:12:34 +0000 |
parents | fbc0540a9208 |
children |
line wrap: on
line source
function Y=returns(I,F,varargin) % returns - Evaluate function and return multiple values in cell array % % returns :: % I:[[M]->[N]] ~'M numbers between 1 and N', % (A(1),...,A(L) -> B(1), ..., B(N)) ~'function with L in and N outputs', % A(1), ..., A(L) ~'arguments for function' % -> cell { B(I(1)), ..., B(I(M)) } ~'selected returns in a cell array'. Z=cell(max(I),1); [Z{:}]=F(varargin{:}); Y=Z(I);