Use the following MATLAB commands to construct a symbolic function. syms x y f = (y +

Question:

Use the following MATLAB commands to construct a symbolic function.
syms x y
f = (y + l)^3 + x * y^2 + y^2 - 4 * x * y - 4 * y + l
Compute the first partials of f and the Hessian of f by setting
fx = dif f (f, x), fy = dif f (f, y)
H = [diff (fx, x), diff (fx, y); diff (fy, x), diff (fy, y)]
We can evaluate the Hessian for a given (x,y) pair using the subs command. For example, to evaluate the Hessian when x = 3 and y = 5, set
HI = subs(H,[x,y],[3,5])
Use the MATLAB command solve (fx, fy) to determine vectors x and y containing the x and y coordinates of the stationary points. Evaluate the Hessian at each stationary point and then determine whether the stationary point is a local maximum, local minimum, or saddle point.
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: