swap(a,b) -- return a permutation that swaps a and b, i.e., (a,b)
0001 function p = swap(a,b) 0002 % swap(a,b) -- return a permutation that swaps a and b, i.e., (a,b) 0003 0004 m = max(a,b); 0005 row = 1:m; 0006 row(a) = b; 0007 row(b) = a; 0008 p = permutation(row);