function H = hankera(Y,nlines,k,q,d);
%
%  hankera
%
%  H = hankera(Y,nlines,k,q,d);
%
%  forms the Hankel matrix w.r.t. time-step k  
%

%  Version SWD960202
%
%  Copyright (c) 1996 by Scott W. Doebling
%	Los Alamos National Laboratory
%	ESA-EA, doebling@lanl.gov
%

nresp = size(Y,1) / nlines;
nref = size(Y,2);

H = zeros(q*nresp,d*nref);


for nr = 1:q,

    nrvec = [ ((nr-1)*nresp + 1) : (nr*nresp) ];

    for nc = 1:d,

       ncvec = [ ((nc-1)*nref + 1) : (nc*nref) ];

       yb = k + nr + nc ;

       yrvec = [ ((yb-1)*nresp + 1): (yb*nresp) ];

       H(nrvec,ncvec) = Y(yrvec,:);

   end

end

return
