用fsolve可解出来:
先构造函数:
function output=solveproblem(X)
c=X(1);
m=X(2);
y=X(3);
output(1)=(1-c)*(1-y)*(1-m)*10.61+y*(1-c)*(1-m)*30.56+c*(1-y)*(1-m)*60.67+m*(1-c)*(1-y)*0.95+y*m*(1-c)*28.45+y*c*(1-m) *8.19+c*m*(1-y) *2.51+c* y*m* 76.69-3.21
output(2)=(1-c)*(1-y)*(1-m)*15.21+y*(1-c)*(1-m)*14.58+c*(1-y)*(1-m)*65.2+m*(1-c)*(1-y)*0.96+y*m*(1-c)*14.23+y*c*(1-m) *17.41+c*m*(1-y) *1.62+m*y *c*80.32
output(3)=(1-c)*(1-y)*(1-m)*44.77+y*(1-c)*(1-m)*9.9+c*(1-y)*(1-m)*3.97+m*(1-c)*(1-y)*0.78+y*m*(1-c)*0.8+y*c*(1-m) *3.3+c*m*(1-y) *7.95+ m*c*y*66.79
然后求解:
x0=[1 1 1]; %初值
ans1 = ones(20,3);
options=optimset('fsolve');
for k=1:20
[x,fval,exitflag,output]=fsolve(@solveproblem,x0,options);
x0=x;
ans1(k,:)=x;
end
ans1 =
-0.2892 0.9143 0.1893
带入三个方程验证,分别等于0.0012,4.8363e-004,-0.0016
你这能不能把它给简化一下?晕