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


