setdiff with reptitions ?
조회 수: 18 (최근 30일)
이전 댓글 표시
i have two array A ,B i need to know all elements that inside A but not B including reptitons ,thx .
댓글 수: 0
채택된 답변
Star Strider
2018년 11월 27일
편집: Star Strider
2018년 11월 27일
Experiment with the ismember (link) funciton or if you are using floating-point numbers, ismembertol (link):
A = randi(9, 1, 10)
B = randi(5, 1, 8)
L = ismember(A, B)
Out = A(L)
or:
Out = A(~L)
depending on the result you want.
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!