%fminsearchBugTest2

% We will minimize the function f(x)=2+(x-2.0)^2+(y-3.0)^2
% but we will pass the 2.0 and 3.0 through an additional
% parameter called dataStructure.

dataStructure{1}=2.0;
dataStructure{2}=3.0;

beta0=[1.5 2.8];

fun = @(beta) fminsearchBugTestFunction (beta, dataStructure);
[beta,fval] = fminsearch(fun,beta0, ...
   optimset('TolX',1e-6,'TolFun',1e-6,'Display','iter','MaxIter',20000,'MaxFunEvals',40000));
