Compute the complement of a set of indices in a known range
조회 수: 34 (최근 30일)
이전 댓글 표시
I want to compute the complement of a set C. The elements are indices in the range 1 to K. Is the best/fastest/simplest way to go around this is using
C = setdiff(A,B)
or since I know they are not arbitrary sets of numbers, is there a better way to go around in MATLAB?
댓글 수: 2
Azzi Abdelmalek
2016년 4월 4일
What do you mean? can you clarify what "not arbitrary sets of numbers" means, with a small example
답변 (1개)
Dave Behera
2016년 4월 6일
Your approach with setdiff seems to be the best way because it is the simplest. I recommend you to use it.
댓글 수: 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!