How to remove zero sum row from matrix
Ältere Kommentare anzeigen
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]
Akzeptierte Antwort
Weitere Antworten (2)
Roger Stafford
am 24 Jan. 2017
A = A(:,(A(2,:)+A(3,:)~=0));
1 Kommentar
Vishal Sharma
am 24 Jan. 2017
Andrei Bobrov
am 24 Jan. 2017
A = A(:,sum(A(2:end,:))~=0);
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!