MATLAB Answers

row elimination problem.

조회 수: 1(최근 30일)
Anurag Gupta
Anurag Gupta 2020년 10월 19일
편집: madhan ravi 2020년 10월 19일
Hey
I have a matrix A of 34x2 double.
I want to eliminate the rows wherein the value of both the columns is 0.

채택된 답변

madhan ravi
madhan ravi 2020년 10월 19일
A(all(A == 0, 2), :) = [ ]
  댓글 수: 3
Anurag Gupta
Anurag Gupta 2020년 10월 19일
Hello Madhan,
Extremely sorry I actually made an error earlier in the loop which lead to me not getting the right answer. Thanks a lot for the solution. It worked perfectly.
Regards,
Anurag Gupta

댓글을 달려면 로그인하십시오.

추가 답변(1개)

Asad (Mehrzad)  Khoddam
Asad (Mehrzad) Khoddam 2020년 10월 19일
A(all(A(:,1:2)==0,2),:)=[];
  댓글 수: 2
Asad (Mehrzad)  Khoddam
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.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by