view general/arrutils/foldrcols.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
parents 03694e5c8365
children
line wrap: on
line source
% foldrcols - fold array columns from the right
%
% foldrcols :; 
%    ([[M]], [[N]] -> [[M]])   ~'folding function',
%    [[M]]                     ~'initial value',
%    [[N,L]]                   ~'data to scan, sequence of length L'
% -> [[M]].

function y=foldrcols(f,y,X,varargin)
	for i=size(X,2):-1:1, y=f(y,X(:,i)); end
end