annotate general/funutils/feval2cell.m @ 9:45aaf9b2d7b0
Moved high-order sequence/list functions to @cell class.
author |
samer |
date |
Mon, 14 Jan 2013 15:49:04 +0000 |
parents |
e44f49929e56 |
children |
|
rev |
line source |
samer@9
|
1 function Y=returns(I,F,varargin)
|
samer@9
|
2 % returns - Evaluate function and return multiple values in cell array
|
samer@4
|
3 %
|
samer@9
|
4 % returns ::
|
samer@9
|
5 % I:[[M]->[N]] ~'M numbers between 1 and N',
|
samer@9
|
6 % (A(1),...,A(L) -> B(1), ..., B(N)) ~'function with L in and N outputs',
|
samer@9
|
7 % A(1), ..., A(L) ~'arguments for function'
|
samer@9
|
8 % -> cell { B(I(1)), ..., B(I(M)) } ~'selected returns in a cell array'.
|
samer@4
|
9
|
samer@4
|
10 Z=cell(max(I),1);
|
samer@4
|
11 [Z{:}]=F(varargin{:});
|
samer@4
|
12 Y=Z(I);
|