上传者: 42184548
|
上传时间: 2022-03-24 16:00:20
|
文件大小: 1.32MB
|
文件类型: -
3.用fminsearch函数求解
输入命令:
f='100*(x(2)-x(1)^2)^2+(1-x(1))^2';
[x,fval,exitflag,output]=fminsearch(f, [-1.2 2])
运行结果:
x =1.0000 1.0000
fval =1.9151e-010
exitflag = 1
output =
iterations: 108
funcCount: 202
algorithm: 'Nelder-Mead simplex direct search'