matlab的灰色作用系数在哪找,关于MATLAB中的linprog函数[x,fval]=linprog(c,a,b,aeq,beq,lb,ub,x0,options)我想知道;1.x,fval是不是...

7d14a2b81882cfe4494b096a84150b2a.png 优质解答

1.yep,you are right.

2.x0:starting point

options:

x = linprog(f,A,b,Aeq,beq,lb,ub,x0,options) minimizes with the optimization options specified in the structure options.Use optimset to set these options.

3.That's OK.Just let the coefficient of x1 to be zero.

4.I think that's fine.But I'm not sure.

Examples

Find x that minimizes

f(x) = –5x1 – 4x2 –6x3,

subject to

x1 – x2 + x3 ≤ 20

3x1 + 2x2 + 4x3 ≤ 42

3x1 + 2x2 ≤ 30

0 ≤ x1,0 ≤ x2,0 ≤ x3.

First,enter the coefficients

f = [-5; -4; -6]

A = [1 -1 1

3 2 4

3 2 0];

b = [20; 42; 30];

lb = zeros(3,1);

Next,call a linear programming routine.

[x,fval,exitflag,output,lambda] = linprog(f,A,b,[],[],lb);

Entering x,lambda.ineqlin,and lambda.lower gets

x =

0.0000

15.0000

3.0000

lambda.ineqlin =

0

1.5000

0.5000

lambda.lower =

1.0000

0

0

Nonzero elements of the vectors in the fields of lambda indicate active constraints at the solution.In this case,the second and third inequality constraints (in lambda.ineqlin) and the first lower bound constraint (in lambda.lower) are active constraints (i.e.,the solution is on their constraint boundaries).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值