用fminsearch求公式的最小值时遇到问题。

f=abs(X0*pi+25/102*X1*(-1)^(14/25)-25/198*X2*(-1)^(11/25)+25/302*X3*(-1)^(14/25))其中,X0,X1,X2,X3,是4组未知数
x0=0.00138 0.00007 0.04239 0.01427
x1=0.00471 0.00004 0.04862 0.04698
x2=0.00498 0.00006 0.06980 0.01472
x3=0.00547 0.00003 0.02375 0.02149
是4组初始值
如何用fminsearch返回最小值,并求出X0,X1,X2,X3
求大神指教啊!!

 Accepted Answer

gimib
gimib on 19 Nov 2022

0 votes

f=@(x) abs(x(1)*pi+25/102*x(2)*(-1)^(14/25)-25/198*x(3)*(-1)^(11/25)+25/302*x(4)*(-1)^(14/25));
x0 = [ 0.00138 0.00007 0.04239 0.01427
0.00471 0.00004 0.04862 0.04698
0.00498 0.00006 0.06980 0.01472
0.00547 0.00003 0.02375 0.02149 ];
x = zeros(4);
fmin = zeros(4,1);
for m = 1:4
[x(:,m),fmin(m)] = fminsearch(f,x0(:,m));
end
[fval,I] = min(fmin)
x(:,I)

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Asked:

on 19 Nov 2022

Answered:

on 19 Nov 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!