>>113 Cosine similarity is \eqn{\frac{\sum_{k=1}^n x_ky_k}{\sqrt{\sum_{k=1}^n x_k^2}\cdot\sqrt{\sum_{k=1}^n y_k^2}}} Minkowski distance is \eqn{\left(\sum_{k=1}^n|x_k - y_k|^p\right)^\frac{1}{p}} Euclidean distance is a speacial case of Minkowski distance when \eqn{p=2} i.e. \eqn{\sqrt{\sum_{k=1}^n (x_k - y_k)^2}} Your matrix is \eqn{X} means: ,bmat x_1 & y_1\\x_2 & y_2\\x_3 & y_3\\x_4 & y_4\\