Info
此问题已关闭。 请重新打开它进行编辑或回答。
Remove repeated row in a matrix (specially zero's repeated row)
1 次查看(过去 30 天)
显示 更早的评论
a =
1 4 6
0 0 0
6 7 3
0 0 0
3 1 2
0 0 0
0 0 0
Remove the repeated zero row.
I want this output
b=
1 4 6
0 0 0
6 7 3
3 1 2
回答(1 个)
Azzi Abdelmalek
2013-11-4
编辑:Azzi Abdelmalek
2013-11-5
EDIT
a = [1 4 6
0 0 0
6 7 3
0 0 0
3 1 2
0 0 0
0 0 0]
idx=find(~any(a,2))
a(idx(2:end),:)=[]
4 个评论
Azzi Abdelmalek
2013-11-5
编辑:Azzi Abdelmalek
2013-11-5
Ok, try this
idx=find(~any(a,2))
a(idx(2:end),:)=[]
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!