求取距离function [p] = profit(x1,x2 ) a=B(1);b=B(2);c=B(3);sym D; D=sqrt((a-x1).^2+(b-x2).^2) p=c*D end