row elimination problem.
1 view (last 30 days)
Show older comments
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 Comments
Accepted Answer
madhan ravi
on 19 Oct 2020
A(all(A == 0, 2), :) = [ ]
3 Comments
madhan ravi
on 19 Oct 2020
Edited: madhan ravi
on 19 Oct 2020
What?
>> A = [1,2; 0,0]
A(all(A == 0, 2), :) = [ ]
A =
1 2
0 0
A =
1 2
>>
More Answers (1)
Asad (Mehrzad) Khoddam
on 19 Oct 2020
A(all(A(:,1:2)==0,2),:)=[];
2 Comments
Asad (Mehrzad) Khoddam
on 19 Oct 2020
I didn't refresh the web page and the time I submitted the answer, there was no anwser to this question.
See Also
Categories
Find more on Simulink Functions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!