Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

How to from I(x) to permutation and from permutation to I(x)

1 Ansicht (letzte 30 Tage)
hang dong
hang dong am 22 Mai 2019
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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 Kommentare
madhan ravi
madhan ravi am 22 Mai 2019
What are your inputs? and what is your desired output? Illustrate with an explicit example.

Antworten (1)

James Tursa
James Tursa am 22 Mai 2019
Bearbeitet: James Tursa am 22 Mai 2019
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 Kommentare
hang dong
hang dong am 22 Mai 2019
haiz.PNG
q = [ 0 1 2 3 5 4]
x = find(ismember(T,q,'rows'))
error. help me!
hang dong
hang dong am 22 Mai 2019
Table A include column I and Per
Table B include column Per
How to use ismember statements?

Diese Frage ist geschlossen.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by