| MatArray Toolbox | Search  Help Desk |
| prettytree | Examples See Also |
Syntax
res = prettytree(tree)
Description
Each line of a hierarchical clusteringtree
represents a node. Except for the first line, which is the root
of the tree, the order in which the lines are presented
does not matter. hierarc produces trees in which
the lines are in a random-looking order. prettytree
sorts the lines so that the first line is the root, the second
line is the second highest node, and so on, and puts the leaves
at the end. This sorting can sometimes ease the coding of
scripts.
Examples
d = sqrt(dl2c(randn(5,5)));
tree=hierarc(d,1)
tree =
5.0000 3.0720 9.0000 2.0000
1.0000 3.0000 0 0
1.0000 4.0000 0 0
1.0000 5.0000 0 0
1.0000 2.0000 0 0
1.0000 1.0000 0 0
2.0000 1.4070 6.0000 5.0000
3.0000 2.0161 7.0000 4.0000
4.0000 2.9849 8.0000 3.0000
prettytree(tree)
ans =
5.0000 3.0720 2.0000 7.0000
4.0000 2.9849 3.0000 8.0000
3.0000 2.0161 4.0000 9.0000
2.0000 1.4070 5.0000 6.0000
1.0000 1.0000 0 0
1.0000 2.0000 0 0
1.0000 3.0000 0 0
1.0000 4.0000 0 0
1.0000 5.0000 0 0
OK, granted, this is not really pretty.
See Also
hierarc