Delete rows in a given array based on values in another array
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi,
I have two arrays A (179528104x1) and B (1x9700). Here, in the array A, I need to retain only the rows that contain values present in the array B and delete all other rows.
댓글 수: 0
채택된 답변
Star Strider
2024년 4월 10일
Perhaps this —
A = randi(99, 50, 1);
Abfr = buffer(A,10) % Show Everything In 'A'
B = randi(99, 10, 1)
[ix,v] = ismember(A, B);
C = A(ix)
.
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!