Finding positions and comparing two arrays

Hi everyone, My question is, how can I change matrix b to c?
c shows the position of b in a.
a=[18 11 12 14 10 15]
b=[10 14 12 15
12 11 12 18
11 14 18 15
18 11 15 18]
c=[5 4 3 6
3 2 3 1
2 4 1 6
1 2 6 1]
Thank you in advance for any advice you can offer.

 採用された回答

Walter Roberson
Walter Roberson 2018 年 2 月 7 日

0 投票

[~, c] = ismember(b, a);

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by