finding duplicates
367 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
A=[ 1 1 2 2 3 3 3];
unique(A)=[1 2 3]; but I want to find the duplicates that are not the first occurrence. i.e x=[2 4 6 7]; I typed help unique but I couldn't figure out if I and J reported by this function helps with my purpose.I know that I can program it but i want to be as efficient as possible in my codes to reduce the running time.
0 commentaires
Réponse acceptée
the cyclist
le 5 Août 2011
Here is one way:
[uniqueA i j] = unique(A,'first');
indexToDupes = find(not(ismember(1:numel(A),i)))
0 commentaires
Voir également
Catégories
En savoir plus sur MATLAB Report Generator dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!