view general/funutils/returns.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
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);