396 Appendix B
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MATLAB code subproblem2.m
% Subproblem-2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The matrix A and b corresponds to equation Ax=b
% c -> vector of cost coefficients
% basic_set -> set of basic variables
% nonbasic_set -> setof nonbasic variables
% B -> matrix containing basic variable columns of A
% N -> matrix containing nonbasic variable columns of A
% xb -> basic variables
% y -> simplex multipliers
% cb -> cost coefficients of basic variables
% cn -> cost coefficients of nonbasic variables
%
clear all
clc
format rational
format compact
A = [2 5 1 0 0;
2 -3 0 1 0;
-1 0 0 0 1];
b = [16;7;-6];
c = [-4;-5;0;0;0];
basic_set = [3 4 5];
nonbasic_set = [1 2];
for i = 1:length(basic_set) ...