MATLAB: Finding number of certain value in each row

find function

Hey there, I'm struggling with a problem finding the number of values greater than a variable(say avgX)for each row. The matrix is 35*24 and the number of values exceed the variable should be listed seperately(i.e there should be 35 answers) Eg a matrix:
3 7 10
6 9 12
1 5 6
AvgX = 8
so the answer in this case should be 1 2 0
Any help is Appreciated

Best Answer

AvgX = 8;
A = [3 7 10
6 9 12
1 5 6];
out = sum(AvgX < A,2);