Deleting every row with a zero in the first column, except the first row

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

 Accepted Answer

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!