MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Asked by huda nawaf
on 26 Aug 2012

This question is closed and may reopen in the future if edited.

hi,

I try to biult the agglomerative algorithm (hierarchical clustering).

x=[0 662 877 255 412 996;

662 0 295 468 268 400;

877 295 0 754 564 138;

255 468 754 0 219 869;

412 268 564 219 0 669;

996 400 138 869 669 0];

the output

x=[0 295;

295 0 ];

where the recorders that must merged as follows. L= R1 R2 Min

3 6 138

4 5 219

1 8 255

2 9 269

7 10 296

for example , the first row contains R1(FIRST RECORD),R2(SECOND RECORD) that must be nerged at first because they have min distance(138), and so on.

I could merged the 3,6 and 4,5 , and got the fokllowing matrix

NaN 662 877 255

662 NaN 295 268

877 295 NaN 564

255 268 564 NaN

Now, when try to merge the next two clusters that have min distance 255, my code is not working properly. The next two clusters will be 1 and 8 as indicated in L above.

where cluster 8 mean the new cluster that have result from merging the two clusters 4 and 5.

who can help me?

i got some agglomerative from this forum , but no one ws clear or get me the results that I need.

thanks in advance

*No products are associated with this question.*

## 1 Comment

## Walter Roberson

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/46739#comment_96245

Please show (or link to) the code you are using.