No, sorry I want to find the position of a number in a matrix then I define a mapping and I want to write in a cycle as I explained in my example.
How to find permutation cycle in matlab?
2 次查看(过去 30 天)
显示 更早的评论
A=
4 1 2 3
1 2 3 4
2 3 4 1
3 4 1 2
I define a function
s4(i)=j for which i , j = 4
as in my case
s4(1)=1
s4(2)=4
s4(3)=3
s4(4)=2
and find permutation as; (1)(24)(3)
How can I find these cycles in matlab ?
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!