 ## Generate a two-cluster problem

C1 = randn (10000, 2) + 1;
C2 = randn (10000, 2) - 1;
 data = [C1; C2];

size(data)
 ## Perform clustering

tic;
 [idx, centers] = kmeans_original (data, 2);
toc;

 ## Plot the result
 figure
 plot (data (idx==1, 1), data (idx==1, 2), 'ro');
 hold on
 plot (data (idx==2, 1), data (idx==2, 2), 'bs');
 plot (centers (:, 1), centers (:, 2), 'kv', 'markersize', 10);
 hold off

# figure
# plot3 (data (idx==1, 1), data (idx==1, 2), data (idx==1, 3), 'ro');
# hold on
# plot3 (data (idx==2, 1), data (idx==2, 2), data (idx==2, 3), 'bs');
# plot3 (centers (:, 1), centers (:, 2), centers (:, 3), 'kv', 'markersize', 10);
# hold off

centers
