% scanrcols - scan array columns from the right
%
% scanrcols :; 
%    ([[M]], [[N]] -> [[M]])   ~'scannning function',
%    [[M]]                     ~'initial value',
%    [[N,L]]                   ~'data to scan, sequence of length L'
% -> [[M,L]].

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

