我想从矩阵中删除重复的行。我读How can I remove duplicates in an array but keep the same order?,但这不完全是我想要的。如何从矩阵中删除重复的行
在溶液上方从矩阵中移除重复的值(细胞)(并返回一个向量),但我需要删除重复行并返回一个矩阵—相同的基质而不重复行。
实施例:
a = [1,2; 3,4; 5,6; 1,2; 7,8]
a =
1 2
3 4
5 6
1 2
7 8
%...
ans =
1 2
3 4
5 6
7 8
的顺序并不重要。
的唯一行,如果你也想保留行的原始顺序,看看这个答案:http://stackoverflow.com/questions/7781749/junk-index-and-unique-on-a-matrix-how-to-keep-matrix-format/7782227#7782227 – Amro