I optimize a problem maximizing EU1 with the fmincon solver..the code below is the objective function i insert in fmincon instruction …
can i somehow get the value of xw1 equation in last itteration??
function EU1 = eq_obj1(LW_ini,LG_obs,LVmat,LLand,rc,X) EU1=0;xw1=0;for i=1:1:length(rc) if (LLand(rc(i))) xw1=xw1+LG_obs(rc(i))*X(i); endendxw1=LW_ini+xw1;% xw1
% class(xw1)
for i=1:1:length(rc) for j=1:1:length(rc) EU1=EU1+LVmat(i,j)*X(i)*X(j); end endEU1=xw1-0.5*EU1/xw1;%EU1=-EU1;
xw1;
Best Answer