Question: Suppose you have an objective function to minimize: 2 4 2 f x y x y x ( , ) 3 . 5 2 =
Suppose you have an objective function to minimize:
f x y x y x x xy y
Create a contour plot of the objective function over the domain of x
and
y
and print it out. This can be conveniently done using the following code:
xVec linspace;
yVec linspace;
xy meshgridxVecyVec;
f x y x xxy y;
figure
clf
contourxyf
grid
If you are unsure what some of those MATLAB commands do please consult the
MATLAB documentation file ie type doc into the Command Window and press Enter
or ask your instructor.
By hand, perform two steps of a steepest descent algorithm using a step size of starting
from an initial guess of By hand, draw the corresponding steps as vectors on the
contour plot from Part to demonstrate how the algorithm is approaching the minimum.
Solve for the unconstrained minimum of the objective function using fminunc. Have
your code print the minimum location to the Command Window as:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
