How to remove zero sum row from matrix
Mostra commenti meno recenti
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]
Risposta accettata
Più risposte (2)
Andrei Bobrov
il 24 Gen 2017
A = A(:,sum(A(2:end,:))~=0);
Categorie
Scopri di più su Mathematics and Optimization in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!