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 个评论
Anusha
Anusha 2013-11-5
编辑:Anusha 2013-11-5
ADD part
a=
[1 4 6
0 0 0
6 7 3
0 0 0
3 1 2
0 0 0
0 0 0
1 0 0]
b=
1 4 6
0 0 0
6 7 3
3 1 2
1 0 0

回答(1 个)

Azzi Abdelmalek
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 个评论

此问题已关闭。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by