Optimization
Optimization
x4 x2
2 x2 x1 f x 2 f x3 x 2 x3 f x 2 f x1
f=@(x) 2+x(1)-
x(2)+2*x(1)^2+2*x(1)*x(2)+x(2)^2
[x, fval] = fminsearch(f, [-0.5, 0.5])
Note that x0 has two entries - f is expecting it to
contain two values.
MATLAB reports the minimum value is 0.7500 at a
location of [-1.000 1.5000]
© McGraw Hill LLC 22
Nelder– Mead Method (N-D)
Genetic Algorithm
Mutation, comparison, survival of the fittest, and reproduction