< >一、正常的输出结果</P> 
< >程序:</P> 
< >f=[-40 -90]';<BR>a=[9 7;-7 -20];<BR>b=[56 -70]';<BR>lb=[5 0]';<BR>[x,fval]=linprog(f,a,b,[],[],lb)</P> 
<P>输出:</P> 
<P>x =</P> 
<P>    5.0000<BR>    1.7500</P> 
<P><BR>fval =</P> 
<P> -357.5000</P> 
<P>二、输出结果不正常的程序</P> 
<P>程序:</P> 
<P>f=[-40 -90]';<BR>a=[9 7;-7 -20;-1 0;0 -1];<BR>b=[56 -70 -5 0]';<BR>[x,fval]=linprog(f,a,b)</P> 
<P>输出:</P> 
<P>x =</P> 
<P>    4.8092<BR>    1.8168</P> 
<P><BR>fval =</P> 
<P> -355.8779</P> 
<P><FONT color=#ff0000>错误提示:</FONT></P> 
<P>Exiting: One or more of the residuals, duality gap, or total relative error<BR>         has stalled:<BR>         the primal appears to be infeasible (and the dual unbounded).<BR>         (The dual residual < TolFun=1.00e-008.)</P> 
<P>将条件x1>=5变为-x1<=-5,应该没错呀。不明白。另外x1>=0时,两种写法都没错。</P> |