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');

추가 답변 (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 Exchange에서 Matrix 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