Professional Documents
Culture Documents
Assignment_optimization_final
Assignment_optimization_final
m 1 of 2
x = xnew;
end
xopt = x;
fopt = f2(xopt);
niter = niter - 1;
% define the gradient of the objective
function g = grad(x)
g = [2*x(1) + x(2)
x(1) + 4*x(2)];