: E, W6 ?7 C* k6 b# l / M2 h W, m& E) [( h运行后的提示文字如下: 5 s9 C, Y* K* M. R+ [$ K/ L - B$ t% x% D/ VLocal minimum found. 0 v5 c* j* v3 U9 V) s @' Y k* c, r: e0 [1 {! S; I* O
Optimization completed because the size of the gradient is less than3 Y) s" A" [4 U- j0 G
the default value of the optimality tolerance.5 Y) R/ B5 S' w6 R4 l9 g5 S
+ N3 h- I+ M( r+ c y- j5 V9 n
<stopping criteria details>5 x; ^- e5 D' F2 j" G U, ]. F
. A) C9 N3 I4 K! w) w& h* P: }
! Q- S4 G& \! R1 } B
ans = - \0 l/ l: ^0 e' [. q% [' [$ c1 Y1 E
0.5898 0.0000 7 I/ I2 H8 H7 M7 f k6 o 9 v1 G& p3 x! h2 h9 ~如何让上述提示文字在命令栏中消失呢?请教大神,非常感谢!4 i1 L7 H/ M5 r 作者: House 时间: 2020-6-5 13:28
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; * l0 e, d( I( w3 Ix0=[0 0]; : C8 m$ N1 p; i; x+ ]5 popts = optimoptions('fminunc','Display','off');1 T/ P9 O: u. L W' u% n. e- i
fminunc(fun,x0,opts);