How can I remove an entire row of zeros in a matrix?
    2 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Dario
 el 8 de Mzo. de 2018
  
    
    
    
    
    Editada: David Fletcher
      
 el 8 de Mzo. de 2018
            If I have a matrix like this one:
 45 23 54
 0  0  0
 9  3  32
How can I remove the second row and obtain this matrix?
45 23 54
9  3  32
0 comentarios
Respuesta aceptada
  David Fletcher
      
 el 8 de Mzo. de 2018
        
      Editada: David Fletcher
      
 el 8 de Mzo. de 2018
  
      a=[45 23 54;0  0  0;9  3  32];
zero=a==0;
ind=all(zero,2);
a(ind,:)=[]
Presumably the entire row has to have zero in every column for it to be removed
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Probability Distributions and Hypothesis Tests en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

