MATLAB: Find params that minimize function

MATLABminimize

I have the function
where I know the , and σ
How can I find the two params x and y that minimize the function which variable is ξ ?

Best Answer

You can define it as an annonymous function and then call fminsearch to solve it:
e = 5;
xi = [1,2,3,4];
yi = [3,4,5,6];
sigma = 2
fun = @(x,e,xi,yi,sigma) abs(4*e- sum(sqrt( (x(1)-xi).^2-(x(2)-yi).^2 ))/(2*sigma^2));
x0 = [1,1];
[x,fval] = fminsearch(@(x)fun(x,e,xi,yi,sigma),x0)
I changed your function with an abs() function, which I believe it was your intention, otherwise your function has no minimum since it can go to -inf.