function clustering(X)
%function clustering(X)
%
% rows are observations
% columns are variables

% Euclidean distance
% D=pdist(X);
% Jaccard
D=pdist(X,'jaccard');
% Correlation
%D=pdist(X,'correlation');

DistanceMatrix = squareform(D)
n=size(X,1);
Similarity_coeff=ones(n,n)-DistanceMatrix
Z1=linkage(D,'single');
Z2=linkage(D,'complete');

subplot(2,1,1)
dendrogram(Z1,0);
title('Observations. Single linkage')
subplot(2,1,2)
dendrogram(Z2,0);
title('Observations. Complete linkage')

