Deleting every row with a zero in the first column, except the first row
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Klaus
am 11 Jun. 2019
Kommentiert: Alex Mcaulley
am 11 Jun. 2019
I have the following Matrix A
A = [0 0; 2 5; 3 6; 7 0; 0 5; 0 3]
I'd like to delete every row that has a 0 in the first column, except the first one.
So thats my code so far
A(all(A(2:end,1)==0,2),:)=[];
it works just as I'd like it to, but it always deletes the 4th row and gives me instead the last one.
Thanks for any help
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!