matlab
优化模型算法
无约束多元函数最小值
fminsearch 函数
X=fminsearch('6*x(1)^3+4*x(1)*x(2)^3-10*x(1)*x(2)+x(2)^2', [0,0]);
[x1,x2]=meshgrid(-5:0.2:5);
f = 6.*x1.^3+4.*x1.*x2.^3+10.*x1.*x2.^2;
mesh(x1,x2,f)
plot(x,f)
fun = @(x)100*(x(2) - x(1)^2)^2 + (1 - x(1))^2;
x0 = [-1.2,1];
options = optimset('PlotFcns',@optimplotfval);
x = fminsearch(fun,x0,options)