Borrar filtros
Borrar filtros

remove rows with all zeros

215 visualizaciones (últimos 30 días)
Rahul
Rahul el 6 de Jun. de 2012
Comentada: Shishir Bapat el 11 de Mzo. de 2021
I have
a =
1 2 3
0 0 0
2 1 0
4 5 0
0 0 0
2 0 1
I need
b=
1 2 3
2 1 0
4 5 0
2 0 1

Respuesta aceptada

Walter Roberson
Walter Roberson el 6 de Jun. de 2012
b = a(any(a,2),:);
  5 comentarios
Mohamed Nedal
Mohamed Nedal el 20 de Dic. de 2019
Hi Walter,
Would you please explain this line?
b = a(any(a,2),:);
Shishir Bapat
Shishir Bapat el 11 de Mzo. de 2021
Thank you

Iniciar sesión para comentar.

Más respuestas (1)

Geoff
Geoff el 6 de Jun. de 2012
Search facility on Answers shows this question is asked a lot... Here's one of the more recent.

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by