linalg: pdist2, repmat, repvec (matlab functions)