Info
この質問は閉じられています。 編集または回答するには再度開いてください。
How to from I(x) to permutation and from permutation to I(x)
1 回表示 (過去 30 日間)
古いコメントを表示
I have the following table:
I Permutation
0 0 1 2 3
1 0 2 3 1
2 0 3 1 2
.......
22 3 2 0 1
23 3 2 1 0
How to from I(x) to permutation and from permutation to I(x)
Exam I(2) -> Per (0 3 1 2)
per(3 2 0 1) -> I(22)
help me!
2 件のコメント
madhan ravi
2019 年 5 月 22 日
What are your inputs? and what is your desired output? Illustrate with an explicit example.
回答 (1 件)
James Tursa
2019 年 5 月 22 日
編集済み: James Tursa
2019 年 5 月 22 日
E.g.,
>> Per
Per =
0 1 2 3
0 2 3 1
0 3 1 2
3 2 0 1
3 2 1 0
>> p
p =
0 3 1 2
>> x = find(ismember(Per,p,'rows'))
x =
3
>> Per(x,:)
ans =
0 3 1 2
>> q = [3 2 0 1]
q =
3 2 0 1
>> x = find(ismember(Per,q,'rows'))
x =
4
>> Per(x,:)
ans =
3 2 0 1
4 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!