How to find same values in two different data sets of different sizes?

1 回表示 (過去 30 日間)
Keri Dalg
Keri Dalg 2017 年 11 月 3 日
コメント済み: Mohammed sohaib 2023 年 2 月 11 日
I have two data sets of unequal length. A = [1 2 3 4 5; 6 7 8 9 0; 5 4 3 2 1; 0 9 8 7 6] and B = [3 4; 8 9; 3 2; 8 7]
Columns 3 and 4 of data set A are the same as all of data set B.
How do i obtain the column indices representing which part of A is the same as B answer desired is [3; 4]
Thanks for all the help in advance!

採用された回答

KL
KL 2017 年 11 月 3 日
C = find(ismember(A.',B.','rows'))
  2 件のコメント
Keri Dalg
Keri Dalg 2017 年 11 月 6 日
Thank you so much! Works well :)
Mohammed sohaib
Mohammed sohaib 2023 年 2 月 11 日
thanks , helped me as well.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by