I would assume you mean you want the “manhattan distance”, (otherwise known as the L1 distance,) between p and each separate row of w. If that assumption is correct, do this.
d = sum(abs(bsxfun(@minus,p,w)),2);
This will give you a 3 x 1 column vector containing the three distances.
Best Answer