getDistMat function

Calculate the Similarity Matrix