for n = 1 :40
    if(unifrnd(0,1) > 0.5)
        x(n) = normrnd(2, 1.0);
        y(n) = normrnd(2, 1.0);
    else
        x(n) = normrnd(5, 1.0);
        y(n) = normrnd(5, 1.0);
    end;
end


[mx, my, b ] = kmeans(x, y, 2)  

for k=1:length(x)
    switch(b(k))
    case 1 
        plot(x(k), y(k), 'xr');
    case 2 
        plot(x(k), y(k), 'xk');
    case 3
        plot(x(k), y(k), 'xg');
    end;
end;
    