comparing 2 vectors for duplicates
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I have a vector of 465051 x 1 elements, and a vector of 1197 x 1 elements. The 465051 vector contains all the 1197 elements, but I don't know where. So I created the following code:
[num,txt,raw] = xlsread('cg_uit_beta2'); %extracting the 465051 vector
A = txt(:,1); %extracting the 465051 vector
[num2,txt2,raw2] = xlsread('cg_uit_beta2_2'); %extracting the 1197 vector
B = txt2(:,1); %extracting the 1197 vector
L = ismember(A,B); %find rownumber of duplicates in the 465051 vector
I = find(L); %find rownumber of duplicates in the 465051 vector
So, now I know where the 1197 duplicates in the 465051 vector are. But now I just need to extract these values out of the 465051 vector... but how do I do that?
Thanks!
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!