How to remove zero sum row from matrix
古いコメントを表示
A=[1 2 3 4 5 6;
0 0 1 1 0 1;
0 0 1 0 1 0]
Sum of second and third row if equal to zero, then in new matrix that column is to be excluded. So, the result shall be
A=[3 4 5 6;
1 1 0 1;
1 0 1 0]
採用された回答
その他の回答 (2 件)
Andrei Bobrov
2017 年 1 月 24 日
A = A(:,sum(A(2:end,:))~=0);
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!