ReplacePart
The ReplacePart function is well documented. Below I give useful function that uses ReplacePart.
In the next cell I make a matrix and I swap the parts at positions {1,2} and
{3,2}.
In the next cell I swap the first row with the third row.
Next I demonstrate that SwapParts can work with arbitrary expressions as well
as matrices.
Created by Mathematica (May 16, 2004)