MATLAB: Extracting data from a matrix

extractmatrix

I have a 50×3 matrix with numerical values. I want to take all the rows that have 2 zeros or more out For example
0 25 15;
0 0 25;
16 13 12
I only want to get out the first and the third row. And I do not wish to do that manually with 50 rows.

Best Answer

a = [0 25 15;
0 0 25;
16 13 12];
out = a(sum(a == 0,2) < 2,:)