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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by