function clusterDist(D)
% D distance matrix
%

% make a row vector
n=size(D,1);
%d=D(2:n,1)'; for k=2:n-1,d = [d,D(k+1:n,k)'];end
d=squareform(D);

Z1=linkage(d,'single');
Z2=linkage(d,'complete');
figure(1)
subplot(2,1,1)
dendrogram(Z1,0);
title('single linkage')
subplot(2,1,2)
dendrogram(Z2,0);
title('complete linkage')

