Reputation: 544
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]
Upvotes: 3
Views: 61
Reputation: 15837
You can use second output of the ismember
function
[~, out]=ismember(A.',B.','rows')
Upvotes: 3