view arrows/asubsample.m @ 6:0ce3c2070089

Removed duplicate code and fixed doc in timed_action.
author samer
date Mon, 14 Jan 2013 14:33:37 +0000
parents 672052bd81f8
children
line wrap: on
line source
% asubsample - Arrow to subsample input sequence.
%
% asubsample :: natural -> arrow({A},{box(A)},natural).
function o=asubsample(N)
	o=loop(@barrier,@(sz)0);
	function [y,s]=barrier(x,s)
		if s==0, y={x}; s=N-1;
		else s=s-1; y={}; end
	end
end