3

I have two binary matrix where one is a permutation of the other: How can I obtain the permutation mapping between both?

Example :

A=[1 0 1 0;1 1 0 0] 
B=[0 0 1 1;1 0 1 0]

A->B should be : [3 1 4 2]

1 Answer 1

3

You can use second output of the ismember function

[~, out]=ismember(A.',B.','rows')
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks @rahnema1 ! That's exactly what i was searching for.
@AKH Glad if I can help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.