Professional Documents
Culture Documents
Kmeans Clustering (MATLAB)
Kmeans Clustering (MATLAB)
Contents
K-means clustering fucntion
Distance function
loop_count = 0;
loop_count = loop_count + 1;
distances = zeros(length(X),k);
for i = 1:length(X)
for j = 1:k
distances(i,j) = distFun(X(i,:),centroids(j,:));
end
end
end
end
le:///home/pholec/Projects/440/Homework/PS4/html/kmeans_cluster.html 1/2
4/6/2017 kmeans_cluster
Distance function
le:///home/pholec/Projects/440/Homework/PS4/html/kmeans_cluster.html 2/2