row elimination problem.
    3 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Anurag Gupta
 il 19 Ott 2020
  
    
    
    
    
    Modificato: madhan ravi
      
      
 il 19 Ott 2020
            Hey
I have a matrix A of 34x2 double.
I want to eliminate the rows wherein the value of both the columns is 0.
0 Commenti
Risposta accettata
  madhan ravi
      
      
 il 19 Ott 2020
         A(all(A == 0, 2), :) = [ ]
3 Commenti
  madhan ravi
      
      
 il 19 Ott 2020
				
      Modificato: madhan ravi
      
      
 il 19 Ott 2020
  
			What? 
>> A = [1,2; 0,0]
   A(all(A == 0, 2), :) = [ ]
A =
     1     2
     0     0
A =
     1     2
>> 
Più risposte (1)
  Asad (Mehrzad) Khoddam
      
 il 19 Ott 2020
        A(all(A(:,1:2)==0,2),:)=[];
2 Commenti
  Asad (Mehrzad) Khoddam
      
 il 19 Ott 2020
				I didn't refresh the web page and the time I submitted the answer, there was no anwser to this question.
Vedere anche
Categorie
				Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
			
	Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


