东华大学matlab数学实验-第四次答案(6)
时间:2025-07-11
时间:2025-07-11
(2)
>> clear;
>> fun=@ (x)x(2).^3/9+3*x(1).^2.*x(2)+9*x(1).^2+x(2).^2+x(1).*x(2)+9; >> [x,g]=fminsearch(fun,[0,0])
x =
0 0
g =
9
>> fun=@ (x)-(x(2).^3/9+3*x(1).^2.*x(2)+9*x(1).^2+x(2).^2+x(1).*x(2)+9); >> [x,g]=fminsearch(fun,[0,-6])
x =
-0.3333 -6.0000
g =
-22.0000
12
>> clear;
>> all=180*7500
all =
1350000
>> first=all*3/10