row elimination problem.
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
madhan ravi
2020년 10월 19일
A(all(A == 0, 2), :) = [ ]
댓글 수: 3
madhan ravi
2020년 10월 19일
편집: madhan ravi
2020년 10월 19일
What?
>> A = [1,2; 0,0]
A(all(A == 0, 2), :) = [ ]
A =
1 2
0 0
A =
1 2
>>
추가 답변 (1개)
Asad (Mehrzad) Khoddam
2020년 10월 19일
A(all(A(:,1:2)==0,2),:)=[];
댓글 수: 2
Asad (Mehrzad) Khoddam
2020년 10월 19일
I didn't refresh the web page and the time I submitted the answer, there was no anwser to this question.
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!