function x=clNCE(c,y,k)
[n,d]=size(y);

x=zeros(n,1);

kk=(1:k)';

for i=1:n,
    yy=y(i,:);
for j=1:k,
    mm(j)=norm(c(j,:)-yy,2);
end
    [mm,ii]=min(mm);
    xx=kk(ii);
    x(i)=xx(1); % incase there is any ambiguity
end
