%Maximizar 3*x1 -2*x2+4*x3
%s.a: 2*x1-8*x2+9*x3=5 
%     x1+5*x3>=8
%     1.6*x1+4.7*x2+8*x3<=4
%      x2<=0
%uso: >>ex_lp2
f=-[3 -2 4 ]
A=[ -1 0 -5; 1.6 4.7 8]
b=[-8;4]
Aeq=[2 -8 9]
beq=[5]

lb=[-Inf -Inf -Inf]
ub=[Inf  0   Inf]

[x, fv]=linprog(f',A,b,Aeq,beq,lb,ub);

fval=-fv
x