If there's a matrix like this:
[20,39,50,80,21;
40,79,80,65, 5;
20,15,60,45,21;
10,60,20,35,70];
How do I calculate the number of rows that have three or more elements which are less than 50?
A
b = A < 50
b
is true: sum(b,2)
nnz(sum(b,2) >= 3)
All together:
numRowsWith3OrMoreValsUnder50 = nnz( sum(A<50, 2) >= 3 );