This code can be used to solve a set of linear equations using Gaussian elimination with partial pivoting. Note that the Augmented matrix rows are not directly switches. Instead a buffer vector is keeping track of the switches made. The final solution is determined using backward substitution.
Of course, this is a homework assignment. NOBODY should actually use it for real work. PERIOD.
Instead, use backslash, solving the linear system of equations:
A*x = b
as
x = A\b;
Note that backslash works for square or non-square systems. It will be far more efficient than the homework assignment found in this submission here.
The help is poor in this code, essentially, non-existent. The only thing I like about the code is the fact that it has internal comments that explain (briefly) what each block of code does.