Skip to content

Commit 0635e51

Browse files
committed
fix kmedoids
1 parent 87260d5 commit 0635e51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chapter09/kmedoids.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
X = X-mean(X,2); % reduce chance of numerical problems
1919
v = dot(X,X,1);
2020
D = v+v'-2*(X'*X); % Euclidean distance matrix
21-
D(sub2ind([d,d],1:d,1:d)) = 0; % reduce chance of numerical problems
21+
D(sub2ind([n,n],1:n,1:n)) = 0; % reduce chance of numerical problems
2222
last = zeros(1,n);
2323
while any(label ~= last)
2424
[~,~,last(:)] = unique(label); % remove empty clusters

0 commit comments

Comments
 (0)