find the repetition of matrix rows
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
the cyclist
2014 年 5 月 8 日
% 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);
その他の回答 (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!