how to remove repeating rows from a matrix?
显示 更早的评论
I know "union" can be used to achieve this, for example, there is an A,
A =
1 2
1 2
1 3
B=union(a,a,'rows')
B =
1 2
1 3
but if A is big(In my case, A is a 20,000*30 matrix), it will be out of memory.
??? Out of memory. Type HELP MEMORY for your options.
ARE there simple ways to delete repeating arrows in a matrix? THX!
2 个评论
Florin Neacsu
2011-10-12
Hi,
Are your repeating lines always one after another? If so, you could use diff and look for [0 0].
Zhang
2011-10-13
回答(2 个)
Steven
2011-10-12
Or even simpler for quick remove :
A(2,:)=[]
will give you B.
类别
在 帮助中心 和 File Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!