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

 Akzeptierte Antwort

dpb
dpb am 2 Okt. 2013
Bearbeitet: dpb am 2 Okt. 2013

1 Stimme

x(~any(x(:,3:end),2),:)=[];

Weitere Antworten (1)

Andrei Bobrov
Andrei Bobrov am 2 Okt. 2013
Bearbeitet: Andrei Bobrov am 2 Okt. 2013

1 Stimme

out = x(all(x(:,3:end),2),:);

Kategorien

Gefragt:

am 2 Okt. 2013

Bearbeitet:

am 2 Okt. 2013

Community Treasure Hunt

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

Start Hunting!

Translated by