SOM Toolbox Online documentation http://www.cis.hut.fi/projects/somtoolbox/

som_linkage

[Z,order,Md] = som_linkage(sM,varargin)

SOM_LINKAGE Make a hierarchical linkage of the SOM map units.

 [Z,order,Dist] = som_linkage(sM, [[argID,] value, ...])
  
  Z = som_linkage(sM);
  Z = som_linkage(D,'complete');
  Z = som_linkage(sM,'single','ignore',find(~som_hits(sM,D)));
  Z = som_linkage(sM,pdist(sM.codebook,'mahal'));
  som_dendrogram(Z); 

  Input and output arguments ([]'s are optional):
   sM       (struct) map or data struct to be clustered
            (matrix) size dlen x dim, a data set: the matrix must not
                     contain any NaN's!
   [argID,  (string) See below. The values which are unambiguous can 
    value]  (varies) be given without the preceeding argID.

   Z        (matrix) size dlen-1 x 3, the linkage info
                     Z(i,1) and Z(i,2) hold the indeces of clusters 
                     combined on level i (starting from bottom). The new
                     cluster has index dlen+i. The initial cluster 
                     index of each unit is its linear index in the 
                     original data matrix. Z(i,3) is the distance
                     between the combined clusters. See LINKAGE
                     function in the Statistics Toolbox.
                     The ignored samples are listed at the 
                     end of the Z-matrix and have Z(*,3) == Inf
   Dist     (matrix) size dlen x dlen, pairwise distance matrix

 Here are the valid argument IDs and corresponding values. The values 
 which are unambiguous (marked with '*') can be given without the
 preceeding argID.
   'linkage' *(string) the linkage criteria to use: 'single' (the
                       default), 'average' or 'complete' 
   'topol'   *(struct) topology struct
   'connect' *(string) 'neighbors' or 'any' (default), whether the
                       connections should be allowed only between 
                       neighbors or between any vectors
              (matrix) size dlen x dlen indicating the connections
                       between vectors
              (scalar) the N-neighborhood upto which the connections
                       should be formed (implies 'neighbors')
   'ignore'   (vector) the units/vectors which should be ignored 
   'dist'     (matrix) size dlen x dlen, pairwise distance matrix to 
                       be used instead of euclidian distances
              (vector) as the output of PDIST function
              (scalar) distance norm to use (euclidian = 2)
   'mask'     (vector) size dim x 1, the search mask used to 
                       weight distance calculation. By default 
                       sM.mask or a vector of ones is used.

 Note that together 'connect'='neighbors' and 'ignore' may form
 areas on the map which will never be connected: connections
 across the ignored map units simply do not exist.

 See also KMEANS_CLUSTERS, LINKAGE, PDIST, DENDROGRAM. 



[ SOM Toolbox online doc ]