rand('seed', 3);

X = [rand(10,2)+1; rand(10,2)+2; rand(10,2)+3];
plot(X(:,1), X(:,2), 'o');
Y = pdist(X);
Z = linkage(Y);
dendrogram(Z);