Documentation Center

  • Trial Software
  • Product Updates


Multisignals 1-D clustering


S = mdwtcluster(X)
S = mdwtcluster(X,'PropName1',PropVal1,'PropName2',PropVal2,...)


S = mdwtcluster(X) constructs clusters from a hierarchical cluster tree. The input matrix X is decomposed in row direction using the DWT function with the haar wavelet and the maximum allowed level.

S = mdwtcluster(X,'PropName1',PropVal1,'PropName2',PropVal2,...) allows you to modify some properties. The valid choices for PropName are:

    Note:   mdwtcluster requires the Statistics Toolbox™


'r' (row) or 'c' (column). Default value is 'r'.


Level of the DWT decomposition. Default value is:
where d=1 or d=2, depending on the dirDec value.


Wavelet name used for DWT. Default value is 'haar'.


DWT extension mode (see dwtmode).


See Statistics Toolbox pdist function. Default value is 'euclidean'.


See Statistics Toolbox linkage function. Default value is 'ward'.


Number of clusters. Default value is 6. The input variable can be a vector.


Cell array that contains the list of data to classify.

If N is the level of decomposition, the allowed name values for the cells are:

  • 's' — Signal

  • 'aj' — Approximation at level j

  • 'dj' — Detail at level j

  • 'caj' — Coefficients of approximation at level j

  • 'cdj' — Coefficients of detail at level j

Default value is {'s';'ca1';...;'caN'}.

The output structure S is such that for each partition j:


Contains the cluster numbers obtained from the hierarchical cluster tree (see cluster in the Statistics Toolbox software).


Contains the inconsistent values of each non-leaf node in the hierarchical cluster tree (see Statistics Toolbox software function inconsistent).


Contains the cophenetic correlation coefficients of the partition (see Statistics Toolbox software function cophenet).

    Note   If maxclustVal is a vector, then IdxCLU is a multidimensional array such that IdxCLU(:,j,k) contains the cluster numbers obtained from the hierarchical cluster tree for k clusters.


load elecsig10
lst2clu = {'s','ca1','ca3','ca6'};

% Compute the structure resulting from multisignal clustering
S = mdwtcluster(signals,'maxclust',4,'lst2clu',lst2clu)

S = 

    IdxCLU: [70x4 double]
    Incons: [69x4 double]
      Corr: [0.7920 0.7926 0.7947 0.7631]

% Retrieve indices of clusters
IdxCLU = S.IdxCLU;

% Plot the first cluster
hold on; 

% Plot the third clustering

% Check the equality of partitions
equalPART = isequal(IdxCLU(:,1),IdxCLU(:,3))

equalPART =


% So we can see that we obtain the same partitions using
% coefficents of approximation at level 3 instead of original
% signals. Much less information is then used.

See Also


Was this topic helpful?