function c=cMCE(x,y,k)
% centroids for a colouring of the points y

[n,d]=size(y);

for i=1:k,
    m(i)=sum(x(x==i));
if m(i)>0,
    for j=1:d,
    c(i,j)=mean(y(x==i,j));
end
else
    c(i,j)=0;
end

end
