First of all, I think you should try fminsearch. It is designed for this kind problem.
If fminsearch cannot help you, but you know something about how they behave, you can try using a manual quantitative approach (just calculating it at a lot of points and see if it behaves well).
If your functions can handle vectorized inputs, it can be done like this:
vec1 = 0:0.1:10; %Assume you expect it somewhere between 0 and 10
vec2 = 0:0.1:10;
[x1, x2] = ndgrid(vec1, vec2);
result = (Y1 - F1(x1, x2))^2 + (Y2 - F2(x1, x2))^2
If this does not work, you can do this:
horzcount = 0;
for x1 = vec1
horzcount = horzcount +1;
vertcount = 0;
for x2 = vec2
vertcount = vertcount + 1;
result(horzcount, vertcount) = (Y1 - F1(x1, x2))^2 + (Y2 - F2(x1, x2))^2;
end
end
Afterwards look at the result (use surf
on an area or plot
on a row or column) and determine whet you are satisfied to have found the region that contains the optimum.
Then zoom in on that region by adjusting vec1 and vec2 accordingly untill you have achieved sufficient precision.