Previous Up Next

6.9.5  Transforming a cycle into a permutation: cycle2perm

A cycle is a type of permutation, but has a different representation.
The cycle2perm command converts a cycle to the cycle written as a permutation.


Example.
Input:

cycle2perm([1,3,5])

Output:


0,3,2,5,4,1

Previous Up Next