Member of the optimization class.
xmin = fminsearch(fun, xstart)
[xmin, fval] = fminsearch(fun, xstart)
Uses the Downhill Simplex method to compute the n-dimensional minimum of a function. You often can use the Downhill Simplex method to minimize discontinuous functions.
| Name | Description |
| fun | Specifies the function whose minimum you want to compute. The function you specify must accept a vector of the same length as xstart and return a scalar. fun is a string. |
| xstart | Specifies the point at which to begin searching for a minimum value of fun. xstart is a real, double-precision vector. |
| Name | Description |
| xmin | Returns the point at which fun has the minimum value. xmin is a real, double-precision vector. |
| fval | Returns the value of fun evaluated at xmin. fval is a real, double-precision scalar. |
This function is not supported in the LabVIEW Run-Time Engine. Do not use this function in a stand-alone application or shared library.
% The myfun function is defined by:
% function f = myfun(x)
% f = x(1)^2-5*x(1)+3*(x(2)+2)^2+2
[XMIN, FVAL] = fminsearch('myfun', [1; 1])