Having problem with 'intersect' function, not giving the obvious result

조회 수: 1 (최근 30일)
yu sh
yu sh 2016년 6월 21일
댓글: yu sh 2016년 6월 21일
Hi everyone, I am using intersect function to compare different arrays and find find out the common rows between them. But I am facing a problem with its result. When I am comparing an array 'H' which is of size 155010x3 double with itself i.e. 'H' it is giving the result as 25896x3 double. However both of them are same so the result should be actual size of 'H' i.e 155010x3 double.
Picture is also attached below.
Anyone please guide me about this.
  댓글 수: 1
Stephen23
Stephen23 2016년 6월 21일
편집: Stephen23 2016년 6월 21일
@yu sh: the screenshots look lovely, but it is much easier for us when you give actual text that we can run. Also please upload the data using the paperclip button.

댓글을 달려면 로그인하십시오.

채택된 답변

the cyclist
the cyclist 2016년 6월 21일
편집: the cyclist 2016년 6월 21일
According to the documentation, intersect reports only the unique rows, without repetition.
You may be able to glean more info from the other output arguments ...
[HH,ia,ib] = intersect(H,H,'rows')
which will indicate which rows of the input matrices were included in the intersection.
  댓글 수: 1
yu sh
yu sh 2016년 6월 21일
Thanks a lot, I think this is the issue because I have repetition of rows.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by