Mercurial > hg > ishara
comparison general/funutils/nthret.m @ 4:e44f49929e56
Adding reorganised general toolbox, now in several subdirectories.
author | samer |
---|---|
date | Sat, 12 Jan 2013 19:21:22 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3:3f77126f7b5f | 4:e44f49929e56 |
---|---|
1 function X=nthret(I,F,varargin) | |
2 % nthret - Evaluate function and return Nth return value. | |
3 % | |
4 % Usage: | |
5 % | |
6 % if F is a function that returns M >= I values, then | |
7 % X = nthret(N,F,...) | |
8 % evaluates [Z{1:N}]=F(...) | |
9 % and returns Z{N}. | |
10 | |
11 Z=cell(I,1); | |
12 [Z{:}]=F(varargin{:}); | |
13 X=Z{I}; |