Home > matgraph > swap.m

swap

PURPOSE ^

swap(a,b) -- return a permutation that swaps a and b, i.e., (a,b)

SYNOPSIS ^

function p = swap(a,b)

DESCRIPTION ^

 swap(a,b) -- return a permutation that swaps a and b, i.e., (a,b)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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);

Generated on Thu 13-Mar-2008 14:23:52 by m2html © 2003