function F=src_subseq(X,T)
% src_subseq - Data source for subsequences of a big array
%
% src_subseq ::
%    [[N,T]]        ~'big array',
%    [[2,P]]        ~'subranges for each of P subsequences'
% -> source(N)      ~'returns a source of N-dim data sequences'.

if nargin<2 || isempty(T), T=[1;size(X,2)]; end;
F=@(z)next_subseq(X,T,1);

function [x,F]=next_subseq(X,T,n), 
	x=X(:,T(1,n):T(2,n));
	if n==size(T,2), F=[]; 
	else F=@(z)next_subseq(X,T,n+1); end

