更多有关单片机、matlab的文章:链接地址
1、fminbnd函数
x = fminbnd(fun,x1,x2)
x = fminbnd(fun,x1,x2,options)
说明:x = fminbnd(fun,x1,x2) returns a value x that is a local minimizer of the function that is described in fun in the interval x1 < x < x2. fun is a function handle.
2、fminsearch函数
x = fminsearch(fun,x0)
x = fminsearch(fun,x0,options)
[x,fval] = fminsearch(…)
fminsearch finds the minimum of a scalar function of sever
1、fminbnd函数
x = fminbnd(fun,x1,x2)
x = fminbnd(fun,x1,x2,options)
说明:x = fminbnd(fun,x1,x2) returns a value x that is a local minimizer of the function that is described in fun in the interval x1 < x < x2. fun is a function handle.
| f = @(x)x.^3-2*x-5; x = fminbnd(f, 0, 2); |
2、fminsearch函数
x = fminsearch(fun,x0)
x = fminsearch(fun,x0,options)
[x,fval] = fminsearch(…)
fminsearch finds the minimum of a scalar function of sever
