Compare two hierarchical trees I want to measure the similarity between two hierarchical trees generated from the same n objects. The two trees are generated using the same metric at two different instants. Thus, I would like to measure how much the tree is changed. My question if there are some measures to compute this similarity? and If there are some functions in Matlab to do this comparison?   
 A: There are many algorithms that compute tree-edit distances, i.e. the minimal number of atomic actions needed to transform one tree into another. In your case (since the number of objects is constant and the trees are hierarchical) it would be the number of matrix permutations. That's quite similar to sequence edit distances and alignment scores. I'm not aware of any implementations in Matlab, though I've seen some implementations in Python, R and JS.
If you need some support-statistics for your estimates, you can use bootstrapping or jackknifing. 
Update
One particular tree-edit distance algorithm was introduced by Zhang et. al (1989). Some implementations:


*

*Python: https://github.com/timtadh/zhang-shasha

*Java: https://github.com/unnonouno/tree-edit-distance/tree/master/tree-edit-distance#id1
There is also a paper by Pawlik et. al (2011) with another algorithm and a speed comparison between several alternatives, including the one mentioned above. 
A: A similar question partly concerns with it. In short, compute correlation coefficient between the following two variables (and cases are all possible pairs of objects): (V1) how much close the two objects are on one tree, (V2) ... are on the other tree. Closeness value is the level on which the two respective clusters containing these two objects merge. As the "level", you might use the distance between the merging clusters (called colligation coefficient) or the clustering step number, or rank of the distance. Such sort of correlation between two hierarchical classifications or dendrograms is called (in biology mostly) cophenetic correlation.
For more information and nuances please search cophenetic correlation on this site and the internet. One particularly nice article is this one: James S. Farris.
On the Cophenetic Correlation Coefficient.
