Matlab: Compute distortion of data clusters