finding value of x in linprog

조회 수: 2 (최근 30일)
bus14
bus14 2019년 5월 6일
댓글: bus14 2019년 5월 6일
Hi community, In my linprog to find an optimal value of x. I got an error that my x was undefined. However, This x should be found by running the linprog. I do not know how I can fix this. As in other linprogs I used it was fine using an unknown in the constraint. The code that I used is:
i=1;
j=1;
c=3;
l=1;
q=14;
s=2;
A1=1;
D=100;
y=10;
z=100;
%objective function is Min c'*x st. y+A1'*z=x x>0 y>0 0<=z<=d
f=[c.'];
Aeq=[y+A1.'*z];
beq=[x];
lb=[0];
ub=[inf];
sol=linprog(f,[],[],Aeq,beq,lb,ub);
x=sol(1)
Problem is that Matlab returns error for an undefined x. is there anyway I can solve this without giving a predetermined value for x? Cause I want to find an x which both satisfies the constraint as the objective function
Thank you!
  댓글 수: 1
bus14
bus14 2019년 5월 6일
I do not understand how this is possible as the linprog should find the optimal value for this x that is to this point unknown. I really hope someone can explain me why this is not working at the moment. Or where in my code there is a mistake.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by