Skip to content

Commit

Permalink
fix kmedoids
Browse files Browse the repository at this point in the history
  • Loading branch information
sth4nth committed Jan 24, 2019
1 parent 87260d5 commit 0635e51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chapter09/kmedoids.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
X = X-mean(X,2); % reduce chance of numerical problems
v = dot(X,X,1);
D = v+v'-2*(X'*X); % Euclidean distance matrix
D(sub2ind([d,d],1:d,1:d)) = 0; % reduce chance of numerical problems
D(sub2ind([n,n],1:n,1:n)) = 0; % reduce chance of numerical problems
last = zeros(1,n);
while any(label ~= last)
[~,~,last(:)] = unique(label); % remove empty clusters
Expand Down

0 comments on commit 0635e51

Please sign in to comment.