|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
代码如下:- fun=@(x)x(1)^2-2*x(1)+1+x(2)^2+x(1)^4+2*x(1)^2*x(2)^2+x(2)^4;
- x0=[0 0];
- fminunc(fun,x0);
, ?$ Y; u" f/ `) ?9 s6 i( e
V; c% a- ]0 C3 I$ s, e' [1 k! ~2 ]$ c9 X" n
$ K7 v# W4 g4 }7 B: J: s运行后的提示文字如下:/ \$ X$ G( F* w5 y& H
4 \ c# n$ `/ K8 p. d1 e3 YLocal minimum found.: F) a' M1 C2 S6 i; i. m
/ E! d6 i. E, z8 lOptimization completed because the size of the gradient is less than
. v3 T* e1 B3 }* {, y5 pthe default value of the optimality tolerance.! h) q1 _; M/ H% i
6 s2 D$ @) \/ ]6 b& n, D: c5 e
<stopping criteria details># Z$ ]7 e. d* X+ ?
* ? {3 C3 F5 K4 o+ s+ r& S7 @8 w2 V4 o. M; O `, B* Q
ans =
! q; z! ~7 r0 ]5 Y4 \& I9 {, p% D+ y8 S+ K
0.5898 0.0000. i( c, o) y X" u1 s b- g$ }
, L, \3 j9 `7 A5 A如何让上述提示文字在命令栏中消失呢?请教大神,非常感谢!
; k5 j5 f) B5 u" s9 c+ c |
|