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!