本文介绍了如何从矩阵中删除重复的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从矩阵中删除重复的行。我阅读了,但这不是我想要的。
I want to remove duplicate rows from a matrix. I read How can I remove duplicates in an array but keep the same order?, but this is not exactly what I want.
上面的解决方案从矩阵中删除重复的值(单元格) (并返回一个向量),但是我需要删除重复的行并返回一个矩阵—
The solution above removes duplicate values (cells) from matrix (and returns a vector), but I need to remove duplicate rows and return a matrix — the same matrix without duplicate rows.
示例:
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
订单无关紧要。
推荐答案
请参阅
这篇关于如何从矩阵中删除重复的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!