Function: % I Is The Entering Basic Variable Column
Function: % I Is The Entering Basic Variable Column
clc
format compact
format rational
A =[2 5 2 1 0 0 38;4 2 3 0 1 0 57;1 3 5 0 0 1 57;-2 -6 -4 0 0 0 0];
[n m]= size(A);
fprintf('This is Table 1 - note the canonical form\n'),disp(A);
for iloop = 1:m
[val ebv] = min(A(n,:));
if val < 0
fprintf('\nEntering Basic Variable Column : '),disp(ebv);
lbv = LBV(A,ebv);
fprintf('\nLeaving Basic Variable (Pivot Row) : '),disp(lbv)
else
fprintf('\nNo further iterations possible')
fprintf('\nYou may have the solution')
fprintf('\nFinal table :')
format short g;
fprintf('\n-------------\n'),disp(A);
break;
end
if lbv > 0
A = RowOperations(A,ebv,lbv);
textstr = strcat('Simplex Table :',num2str(iloop+1));
disp(textstr);
disp(A);
end
end
if j == 0
fprintf('Not possible to evaluate EBV ');
end
ret = j;