MATLAB: Finding minimum values for two-unknown equation!!!

equationfminsearchhypotminimize

Hello,
'a' 'b' 'c' 'd' are known in the equation. We are trying to find values for 'x' and 'y' that minimizes 'F'
Is it possible to insert this function directly in to Matlab? If yes, how can we minimize?
Thanks

Best Answer

This works:
a = 3;
b = 5;
c = 7;
d = 13;
% % x = xy(1), y = xy(2)
F = @(xy) hypot(xy(1)-a, xy(2)-b) + hypot(xy(1)-c, xy(2)-d)
[xy, fval] = fminsearch(F,[1 1])
Related Question