# Dendrograms using clustergram vs traditional ways in Matlab

Good Morning,

By comparing the dendrograms produced by the clustergram object and the "manual" approach i.e. pdist -> linkage -> dendrogram I found they are different, but cannot find an explanation for that difference.

Clustergram documentation says that the default distance used is 'Euclidean' and the default linkage method is 'Average', same parameters I used for pdist and linkage functions.

I thought it might be related with the standardization performed by clustergram, so I used zscore for standardizing first my matrix and then each column separately, but the dendrograms are still different as compared with the one produced by clustergram.

Can somebody explain the reason behind that difference, and how can I use the "manual" approach for getting the same dendrogram?

Edit: I compared the results obtained by the "manual" approach with the SPSS results and they are the same.
Also I tested all different 'data processing' options with clustergram but the dendrogram keeps being different.

-

pdist -> linkage -> dendrogram is also used in clustergram, just open the clustergram code:

dist = pdist(data, pdistArgs{:});

Yes, I've thought about that and performed some tests: c = clustergram(A,'Cluster','column'); and c = clustergram(A,'Cluster','all');. However both lines return the same "column" dendrogram and same heat map with different order in the heat map. –  Diego Oct 11 '12 at 16:21