annotate general/funutils/nthret.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
parents e44f49929e56
children
rev   line source
samer@4 1 function X=nthret(I,F,varargin)
samer@4 2 % nthret - Evaluate function and return Nth return value.
samer@4 3 %
samer@4 4 % Usage:
samer@4 5 %
samer@4 6 % if F is a function that returns M >= I values, then
samer@4 7 % X = nthret(N,F,...)
samer@4 8 % evaluates [Z{1:N}]=F(...)
samer@4 9 % and returns Z{N}.
samer@4 10
samer@4 11 Z=cell(I,1);
samer@4 12 [Z{:}]=F(varargin{:});
samer@4 13 X=Z{I};