find the repetition of matrix rows
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
yousef Yousef
am 8 Mai 2014
Kommentiert: yousef Yousef
am 8 Mai 2014
I want to find out if the row i of mxn matrix is repeated ,the code should give logic 1.Otherwise zero"there are many ways but Im searching for the best one" Thanks
0 Kommentare
Akzeptierte Antwort
the cyclist
am 8 Mai 2014
% Example of data
X = [6 5 4;
1 2 3;
1 2 3;
1 2 4;
1 2 3];
[~,~,A] = unique(X,'rows','stable');
[n, bin] = histc(A, unique(A));
multiple = find(n > 1);
indexToDuplicate = ismember(bin, multiple);
Weitere Antworten (0)
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!