plot(x, y, '.', 'MarkerSize', 15);
title('Original, unscaled and unclassified data', 'FontSize',fontSize)
[classIndexes, classCentroids] = kmeans([x(:), y(:)], 2)
plot(x(classIndexes == 1), y(classIndexes == 1), 'r.', 'MarkerSize', markerSize);
plot(x(classIndexes == 2), y(classIndexes == 2), 'b.', 'MarkerSize', markerSize);
plot(classCentroids(1,1), classCentroids(1,2), 'm+', 'MarkerSize', 150, 'LineWidth', 3)
plot(classCentroids(2,1), classCentroids(2,2), 'm+', 'MarkerSize', 100, 'LineWidth', 3)
caption = sprintf('2 clusters and their centroids\nas determined from original (NOT normalized) data')
title(caption, 'FontSize',fontSize)
[Nx, Cx, Sx] = normalize(x)
[Ny, Cy, Sy] = normalize(y)
[classIndexesN, classCentroidsN] = kmeans([Nx(:), Ny(:)], 2);
plot(Nx(classIndexesN == 1), Ny(classIndexesN == 1), 'r.', 'MarkerSize', markerSize);
plot(Nx(classIndexesN == 2), Ny(classIndexesN == 2), 'b.', 'MarkerSize', markerSize);
x1N = classCentroidsN(1,1);
y1N = classCentroidsN(1,2);
x2N = classCentroidsN(2,1);
y2N = classCentroidsN(2,2);
plot(x1N, y1N, 'm+', 'MarkerSize', 150, 'LineWidth', 3)
plot(x2N, y2N, 'm+', 'MarkerSize', 100, 'LineWidth', 3)
caption = sprintf('2 clusters and their centroids\nas determined from normalized data')
title(caption, 'FontSize',fontSize)
plot(x(classIndexesN == 1), y(classIndexesN == 1), 'r.', 'MarkerSize', markerSize);
plot(x(classIndexesN == 2), y(classIndexesN == 2), 'b.', 'MarkerSize', markerSize);
plot(x1, y1, 'm+', 'MarkerSize', 100, 'LineWidth', 3)
plot(x2, y2, 'm+', 'MarkerSize', 100, 'LineWidth', 3)
caption = sprintf('2 clusters and their centroids\nas determined from normalized data')
title(caption, 'FontSize',fontSize)