We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87260d5 commit 0635e51Copy full SHA for 0635e51
chapter09/kmedoids.m
@@ -18,7 +18,7 @@
18
X = X-mean(X,2); % reduce chance of numerical problems
19
v = dot(X,X,1);
20
D = v+v'-2*(X'*X); % Euclidean distance matrix
21
-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
22
last = zeros(1,n);
23
while any(label ~= last)
24
[~,~,last(:)] = unique(label); % remove empty clusters
0 commit comments