Ain=[1 -5 -3 0 0 0 0
0 2 3 1 0 0 15
0 2 1 0 1 0 9
0 1 -1 0 0 1 3]
A0=Ain;
bin=Ain(:,end);
row=4;col=2;
basis=[3 4 5];
disp(['original basis is: ',num2str(basis)])
keyboard
disp(['pivot on row,col: ',num2str([row col])]);
A=piv(Ain,row,col)
basis=[ 3 4 1];
disp(['new basis is: ',num2str(basis)])
Ain=A;
bin=Ain(:,end);
keyboard
row=3;col=3;
disp(['pivot on row,col: ',num2str([row col])]);
A=piv(Ain,row,col)
basis=[ 3 2 1];
disp(['new basis is: ',num2str(basis)])
Ain=A;
bin=Ain(:,end);
keyboard
row=2;col=6;
disp(['pivot on row,col: ',num2str([row col])]);
A=piv(Ain,row,col)
basis=[5 2 1];
disp(['new basis is: ',num2str(basis)])
keyboard
