For 3*3 matrix A, type the following to get the 3rd row 1st, the 1st row second, and the 2nd row 3rd
A(1:3, :) = [A(3,:); A(1,:); A(2,:)]
To change rows 1 and 2, type the following:
A(1:2, :) = [A(2,:) ; A(1,:)]
Follow the same steps given above for interchanging three rows.