I am trying to re-sort a data table according to the output from hierarchical clustering.
That is, I have a table with 24 observations across 3 parameters (a,b,c):
If I compute the hierachical clustering as:
tree = linkage(X,'average','euclidean');
I get the figure:
To get the order of the leaf nodes I run:
and outperm (1x24 double) gives me a vector with the leaf node order:
1 16 4 3 12 15 10 14 18 6 17 7 20 5 11 19 21 2 23 9 8 22 13 24
Now what I want to do is re-order my original table (24X3 double) according to the sequence of this leaf node order. That is:
a b c
Is there a MatLab way to do this other than to manually copy/paste in an excel file?