早教吧 育儿知识 作业答案 考试题库 百科 知识分享

functionf=myfun(X)f=0.34*X(1)+0.004*X(2)+0.14*X(3)+0.24*X(4)+0.08*X(5)+0.03*X(6)+6.05*X(7);goal=functionf=myfun(X)f=0.34*X(1)+0.004*X(2)+0.14*X(3)+0.24*X(4)+0.08*X(5)+0.03*X(6)+6.05*X(7);goal=[1,1,1];weight=[1,1,1];X0=[190;150;120;60;800;1100;4];

题目详情
function f=myfun(X) f=0.34*X(1)+0.004*X(2)+0.14*X(3)+0.24*X(4)+0.08*X(5)+0.03*X(6)+6.05*X(7); goal=
function f=myfun(X)
f=0.34*X(1)+0.004*X(2)+0.14*X(3)+0.24*X(4)+0.08*X(5)+0.03*X(6)+6.05*X(7);
goal=[1,1,1];
weight=[1,1,1];
X0=[190;150;120;60;800;1100;4];
b=[0;0;0;0;0;0;0;400;-340];
Aeq=[0.3175;1;0.4762;0.3448;0.3816;0.3704;0];
beq=[990];
lb=[170;135;60;0;700;1000;2];
ub=[250;190;160;60;1000;1300;12];
A=[0.3 -1 0.3 0.3 0 0 0
-0.45 1 -0.45 -0.45 0 0 0
0 0 0 0 -0.65 0.35 0
0 0 0 0 0.58 -0.42 0
-14.6 29.77 -14.6 -14.6 0 0 0
0.01 0 0 0 0 0 -1
-0.02 0 0 0 0 0 1
1 0 1 1 0 0 0
-1 0 -1 -1 0 0 0];
[X,fval,attainfactor,exitflag]=fgoalattain(@myfun,X0,goal,weight,A,b,Aeq,beq,lb,ub)
运行时出现Maximum recursion limit of 500 reached.Use set(0,'RecursionLimit',N)
to change the limit.Be aware that exceeding your available stack space can
crash MATLAB and/or your computer.
Error in ==> optimget at 166
set(0,'RecursionLimit',N)将500 递归限制改大后无法运行
▼优质解答
答案和解析
f(1)=-p*x(1)-0.3*x(2)-0.3*x(3); f(2)=-0.34*x(4)-0.34*x(5)-0.34*x(6); f(3)=0.5*f(1)
看了 functionf=myfu...的网友还看了以下: