在做论文,
求下列方程的最小值,要程序代码 :loveliness:
f(x)=(5x(1)+9x(2)+4x(3)+7x(4)+3x(5)-4)^2
+(7x(1)+2x(2)+6x(3)+2x(4)+5x(5)-3)^2
+(3x(1)+1x(2)+5x(3)+4x(4)+9x(5)-5)^2
+(2x(1)+1x(2)+3x(3)+5x(4)+6x(5)-4)^2
+(4x(1)+5x(2)+3x(3)+7x(4)+1x(5)-3)^2
其中x(1),x(2),x(3),x(4),x(5)≥0;

 Réponse acceptée

coyedid
coyedid le 24 Nov 2022

0 votes

x=fmincon(@(x)(5*x(1)+9*x(2)+4*x(3)+7*x(4)+3*x(5)-4).^2+(7*x(1)+2*x(2)+6*x(3)+2*x(4)+5*x(5)-3).^2+(3*x(1)+1*x(2)+5*x(3)+4*x(4)+9*x(5)-5).^2+(2*x(1)+1*x(2)+3*x(3)+5*x(4)+6*x(5)-4).^2+(4*x(1)+5*x(2)+3*x(3)+7*x(4)+1*x(5)-3).^2,rand(5,1),[],[],[],[],zeros(5,1),[])
fmin=(5*x(1)+9*x(2)+4*x(3)+7*x(4)+3*x(5)-4).^2+(7*x(1)+2*x(2)+6*x(3)+2*x(4)+5*x(5)-3).^2+(3*x(1)+1*x(2)+5*x(3)+4*x(4)+9*x(5)-5).^2+(2*x(1)+1*x(2)+3*x(3)+5*x(4)+6*x(5)-4).^2+(4*x(1)+5*x(2)+3*x(3)+7*x(4)+1*x(5)-3).^2

Plus de réponses (0)

Catégories

En savoir plus sur 数据类型 dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!