Hi, everyone. There are some data in array:
A=[3 3 2011;22 3 2011;23 3 2011;24 3 2011;25 3 2011;26 3 2011;27 3 2011];
I'm trying to find matching data using 'ismember':
B=[23 3 2011;27 3 2011];
[tf, index]=ismember(A,B);
But A(1,1) is also written as correct value. How can I solve it?

 採用された回答

Honglei Chen
Honglei Chen 2012 年 7 月 13 日

3 投票

[tf, index]=ismember(A,B,'rows');

1 件のコメント

vvf vvff
vvf vvff 2020 年 2 月 26 日
thanks !!!!!!!!!!!!!!!!!!!!!!!!

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

その他の回答 (2 件)

Artyom
Artyom 2012 年 7 月 13 日

0 投票

Ok, and if we have:
A=[3 3 2011 3 6;
22 3 2011 7 3;
23 3 2011 6 4;
24 3 2011 1 3;
25 3 2011 5 4;
26 3 2011 9 7;
27 3 2011 3 2];

2 件のコメント

Honglei Chen
Honglei Chen 2012 年 7 月 13 日
編集済み: Honglei Chen 2012 年 7 月 13 日
Then simply do
[tf, index]=ismember(A(:,1:3),B,'rows');
BTW you may want to update your problem next time instead of adding an answer to rephrase the question.
Artyom
Artyom 2012 年 7 月 13 日
Thank you.

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

Sonia PAGUI
Sonia PAGUI 2021 年 10 月 5 日

0 投票

Salut Mon code affiche l'erreur a propos de "find_row_array" quelqu'un peut m'aider???

カテゴリ

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

タグ

質問済み:

2012 年 7 月 13 日

回答済み:

2021 年 10 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by