remove rows with all zeros
    조회 수: 100 (최근 30일)
  
       이전 댓글 표시
    
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
댓글 수: 0
채택된 답변
  Walter Roberson
      
      
 2012년 6월 6일
        b = a(any(a,2),:);
댓글 수: 5
  Mohamed Nedal
 2019년 12월 20일
				Hi Walter, 
Would you please explain this line? 
b = a(any(a,2),:); 
추가 답변 (1개)
  Geoff
      
 2012년 6월 6일
        Search facility on Answers shows this question is asked a lot... Here's one of the more recent.
댓글 수: 0
참고 항목
카테고리
				Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
			
	제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





