Compute the complement of a set of indices in a known range
34 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Azzi Abdelmalek
am 4 Apr. 2016
What do you mean? can you clarify what "not arbitrary sets of numbers" means, with a small example
Antworten (1)
Dave Behera
am 6 Apr. 2016
Your approach with setdiff seems to be the best way because it is the simplest. I recommend you to use it.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!