calculating distance between two points matlab code example Example: two point distance matlab >> x = [0 0]; >> y = [2 1]; >> norm(x-y) ans = 2.2361