Delete Rows with a specific condition

I have a matrix and I want to delete all rows that have ZEROS from columns 3 to end. How do?

 Accepted Answer

dpb
dpb on 2 Oct 2013
Edited: dpb on 2 Oct 2013
x(~any(x(:,3:end),2),:)=[];

More Answers (1)

Categories

Asked:

on 2 Oct 2013

Edited:

on 2 Oct 2013

Community Treasure Hunt

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

Start Hunting!