%
% add path matlab/toolbox/stats before running this program
%
x1=linspace(-1,1,5);
x2=linspace(-1,1,5);
X=[];
for i=1:5
    for j=1:5
        X=[X;rand(100,2)*0.25+[ones(100,1)*x1(i) ones(100,1)*x2(j)]];
    end
end         

plot(X(:,1),X(:,2),'.');
hold on;    
[cidx, ctrs] = kmeans(X,25);
plot(ctrs(:,1),ctrs(:,2),'ro');
