% Numerical Mathematics and Computing, Fifth Edition
% Ward Cheney & David Kincaid
% Brooks/Cole Publ. Co.
% (c) 2002
%
% file: lin_prog3.m
%
% Solving the linear programming problem: 
% Minimize function objective subject to given equality constraints.
%
f = [0; 0; 0; 1; 1; 1; 1; 1; 1]
Aeq = [2 3 -5 -1 0 0 1 0 0
     1 -1 0 0 -1 0 0 1 0
     1 2 -3 0 0 -1 0 0 1]
beq = [4; 2; 7]
A=[]
b = []
lb = zeros(9,1)
ub = Inf
[y, fval] = linprog(f, A, b, Aeq, beq, lb)
x1 = y(1) - y(3)
x2 = y(2) - y(3)



