function a = gmmclassifier(mix, x)

x=x';

a = zeros(1, mix.ncentres);  

 
  normal = (2*pi)^(mix.nin/2);
  s = prod(sqrt(mix.covars), 2);
  for j = 1:mix.ncentres
    diffs = x - ( mix.centres(j, :));
    a(:, j) = mix.priors(j)*exp(-0.5*sum((diffs.*diffs)./(mix.covars(j, :)), 2)) ./ (normal*s(j));
  end 
  a=sum(a);
  


