matlab 如何求函数最小值

问题描述:

matlab 如何求函数最小值
g(x) = x sin(2x - 1)
0

>> [x,fval] = fminbnd('x*sin(2*x-1)',0,2)
x =
0.2601
fval =
-0.1201
当x取0.2601时,函数有最小值-0.1201
当然答案是近似值