Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Remove repeated row in a matrix (specially zero's repeated row)
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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
Respuestas (1)
Azzi Abdelmalek
el 4 de Nov. de 2013
Editada: Azzi Abdelmalek
el 5 de Nov. de 2013
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 comentarios
Azzi Abdelmalek
el 5 de Nov. de 2013
Editada: Azzi Abdelmalek
el 5 de Nov. de 2013
Ok, try this
idx=find(~any(a,2))
a(idx(2:end),:)=[]
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!