% % Written by: % -- % John L. Weatherwax 2007-07-01 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- clc; format rat; tab = [ 2, -3, 1, 1, 0, 0, 0, 2 ; 1, 5, -2, 0, 1, 0, 0, 4; 2, -4, -1, 0, 0, 1, 0, 3; -2, -1, +1, 0, 0, 0, 1, 0 ] % the first row is the pivot row for the first step: tab(1,:) = tab(1,:)/2; tab(2,:) = -tab(1,:) + tab(2,:); tab(3,:) = -2 * tab(1,:) + tab(3,:); tab(4,:) = 2 * tab(1,:) + tab(4,:); tab % the second row is the pivot row for the second step: tab(2,:) = (2/13) * tab(2,:); tab(1,:) = (3/2) * tab(2,:) + tab(1,:); tab(3,:) = tab(2,:) + tab(3,:); tab(4,:) = 4 * tab(2,:) + tab(4,:); tab