Say you take the matrix
>> A = magic(4)
A =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
If you want to swap, say, columns 3 and 1, you write
>>A(:,[1 3]) = A(:,[3 1])
A =
3 2 16 13
10 11 5 8
6 7 9 12
15 14 4 1
The same works for swapping rows (i.e. A([4 2],:) = A([2 4],:)
to swap rows 2 and 4).