matlab程序出错,求助,急急急!!!

来源:百度知道 编辑:UC知道 时间:2024/05/30 00:10:14
c=[-0.05;-0.08];
A=[0.1,0.2];
b=[1400];
xlb=zeros(2,1);
xub=[8000;5000];
x0=[0;0];
x=linprog(c,A,b,xlb,xub,x0)
profit=-c'*x-4000/30

出错提示:
??? Error using ==> linprog
The number of columns in Aeq must be the same as the length of f.

Error in ==> Untitled at 7
x=linprog(c,A,b,xlb,xub,x0)
如何修改程序,请赐教,急急急!!
急需修改后的程序

是这样的:

c=[-0.05;-0.08];
A=[0.1,0.2];
b=[1400];
xlb=zeros(2,1);
xub=[8000;5000];
x0=[0;0];
x=linprog(c,A,b,[],[],xlb,xub,x0)
profit=-c'*x-4000/30

结果:
Optimization terminated.

x =

1.0e+003 *

8.0000
3.0000

profit =

506.6667

x =

1.0e+003 *

8.0000
3.0000

profit =

506.6667
一般人我不告诉他……