need help with this problem
Show older comments
hello I'm interesting on linkage methods on hierarchical clustering
i extracted this function from another function in Matlab library (please see the attached file)
i searched on it for median linkage and i found this
case 'me' % median linkage
Y(I) = (Y(I) + Y(J))/2 - v /4;
my question is What does v equal to.?
because the code says
if any(strcmp(method,{'ce' 'me' 'wa'}))
Y = Y .* Y;
end
if strcmp(method,'av')
p = (m-1):-1:2;
I = zeros(m*(m-1)/2,1);
I(cumsum([1 p])) = 1;
I = cumsum(I);
J = ones(m*(m-1)/2,1);
J(cumsum(p)+1) = 2-p;
J(1)=2;
J = cumsum(J);
W = N(R(I)).*N(R(J));
[v, k] = min(Y./W);
else
[v, k] = min(Y);
end
so i put
Y = Y .* Y;
[v, k] = min(Y);
and when i execute my function i get this error
Unable to perform assignment because the left and right sides have a different number of elements.
Error in Hierarchical_clustering>Linkage (line 226)
Y(I) = (Y(I) + Y(J))/2 - v /4;
Accepted Answer
More Answers (1)
Abdelmalek Benaimeur
on 3 Apr 2019
0 votes
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!