function M=reconstruct(X)

%    Reconstruction of image
%
%    ===========================================================
%    M=reconstruct(X)
% 
%    This function builds 16 x 23 blocks from the column vectors in 
%    X and put these blocks together in a matrix M.
%    X should have dimension 368 x 28
%    M has dimension 112 x 92.


for rowblock=1:7         %112/16
  for colblock=1:4      %  92/23
    Block=reshape(X(:,(rowblock-1)*4+colblock),16,23);
    M((rowblock-1)*16+1:rowblock*16,(colblock-1)*23+1:colblock*23)=Block;
  end
end
