To write a script to study the unconstrained minimum of the function f(x; y) = ¡exp(x-y) * (x^2 - 2y^2) in MATLAB, you can use the optimization toolbox functions provided by MATLAB. Specifically, the fminunc
function can be used to find the unconstrained minimum.
Here is an example script that demonstrates how to use fminunc
to minimize the given function:
main.m376 chars18 lines
In this script, the objective function f
is defined using an anonymous function. The initial guess for the minimum is set as x0
. The optimoptions
function is used to set the display option for fminunc
. Finally, fminunc
is called with the objective function f
, initial guess x0
, and options to find the minimum point x
and its corresponding value fval
. The results are then displayed.
Make sure you have the optimization toolbox installed in MATLAB to use the fminunc
function.
gistlibby LogSnag