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 中查找有关 Simulink Functions 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!