annotate general/funutils/apply.m @ 4:e44f49929e56
Adding reorganised general toolbox, now in several subdirectories.
author |
samer |
date |
Sat, 12 Jan 2013 19:21:22 +0000 |
parents |
|
children |
fbc0540a9208 |
rev |
line source |
samer@4
|
1 function varargout=apply(fn,args)
|
samer@4
|
2 % apply - Apply function to list (cell array) of arguments
|
samer@4
|
3 %
|
samer@4
|
4 % Not typable.
|
samer@4
|
5 %
|
samer@4
|
6 % if [y1,y2,...]=fn(x1,x2,...), then
|
samer@4
|
7 % [y1,y2,...]=apply(fn,{x1,x2,...})
|
samer@4
|
8
|
samer@4
|
9 [varargout{1:max(1,nargout)}] = feval(fn,args{:});
|