function res = seq2mat (sequence)

nntwarn off;

load gabor;
for z = 1:size(sequence,2)
    sequence{z} = adapthisteq(sequence{z},'Numtiles',[8 3]); 
    Features135x144 = cell(5,8);  
    for s = 1:5
        for j = 1:8
            Features135x144{s,j} = ifft2(G{s,j}.*fft2(double(sequence{z}),32,32),27,18);
        end
    end
    Features135x144 = abs(cell2mat(Features135x144));
    Features135x144 (3:3:end,:,:)=[];
    Features135x144 (2:2:end,:,:)=[];
    Features135x144 (:,3:3:end,:)=[];
    Features135x144 (:,2:2:end,:)=[];
    Features45x48 = premnmx(Features135x144);
    res(:,z) = reshape (Features45x48,[2160 1]);
end
