Illustration of gauss-jordan:
Here's an illustration of performing such substitutions by using MATLAB
>> a = [1 3 0; 2 1 3; 4 2 3]
a =
1 3 0
2 1 3
4 2 3
>> b = [1 6 3]'
b =
1
6
3
>> ab = [a b]
ab =
1 3 0 1
2 1 3 6
4 2 3 3
>> ab(2,:) = ab(2,:) - 2*ab(1,:)
ab =
1 3 0 1
0 -5 3 4
4 2 3 3
>> ab(3,:) = ab(3,:) - 4 * ab(1,:)
ab =
1 3 0 1
0 -5 3 4
0 -10 3 -1
>> ab(3,:) = ab(3,:) - 2 * ab(2,:)
ab =
1 3 0 1
0 -5 3 4
0 0 -3 -9
>> ab(2,:) = ab(2,:) + ab(3,:)
ab =
1 3 0 1
0 -5 0 -5
0 0 -3 -9
>> ab(1,:) = ab(1,:) + 3/5*ab(2,:)
ab =
1 0 0 -2
0 -5 0 -5
0 0 -3 -9