MATLAB: How to count values in a matrix

MATLABvolume fraction

I have a matrix with size 1887×2048, for each element is a number from 0 to 255. I want to find out how many elements is bigger than 100 and how many smaller than 100 (aka volume fraction)

Best Answer

volumefraction = mean2(YourMatrix>100);