BS=rand(7,2);
r=rand(7,1);
F=@(xy)(2*r(1).*hypot(xy(1)-BS(1,1),xy(2)-BS(1,2))+(hypot(xy(1)-BS(1,1),xy(2)-BS(1,2))).^2 ...
+2*r(2).*hypot(xy(1)-BS(2,1),xy(2)-BS(2,2))+(hypot(xy(1)-BS(2,1),xy(2)-BS(2,2))).^2 ...
+2*r(3).*hypot(xy(1)-BS(3,1),xy(2)-BS(3,2))+(hypot(xy(1)-BS(3,1),xy(2)-BS(3,2))).^2 ...
+2*r(4).*hypot(xy(1)-BS(4,1),xy(2)-BS(4,2))+(hypot(xy(1)-BS(4,1),xy(2)-BS(4,2))).^2 ...
+2*r(5).*hypot(xy(1)-BS(5,1),xy(2)-BS(5,2))+(hypot(xy(1)-BS(5,1),xy(2)-BS(5,2))).^2 ...
+2*r(6).*hypot(xy(1)-BS(6,1),xy(2)-BS(6,2))+(hypot(xy(1)-BS(6,1),xy(2)-BS(6,2))).^2 ...
+2*r(7).*hypot(xy(1)-BS(7,1),xy(2)-BS(7,2))+(hypot(xy(1)-BS(7,1),xy(2)-BS(7,2))).^2);
out=fmincon(F,[1,1],[1,1],inf)