lingo最值和优化.pptVIP

  • 1
  • 0
  • 约1.19千字
  • 约 11页
  • 2017-08-15 发布于江西
  • 举报
lingo最值和优化.ppt

[x,fval]=fminbnd(x^2+3*x+2,-5,5) x = -1.5000 fval = -0.2500 [x,fval]=fminbnd((x^3+cos(x)+x*log(x))/exp(x),0,1) x = 0.5223 fval = 0.3974 fminsearch(2*x(1)^3+4*x(1)*x(2)^3-10*x(1)*x(2)+x(2)^2,[0 0]) ans = 1.0016 0.8335 fminsearch(3*x(1)^2+2*x(1)*x(2)+x(2)^2,[1 1]) ans = 1.0e-004 * -0.0675 0.1715 fun=inline(3*x(1)^2+2*x(1)*x(2)+x(2)^2) fun = Inline function: fun(x) = 3*x(1)^2+2*x(1)*x(2)+x(2)^2 x0=[1 1]; x=fminunc(fun,x0) Warning: Gradient must be provided for trust-region method; using line-search method instead. In fminunc at 24

文档评论(0)

1亿VIP精品文档

相关文档