matlab count the number of elements bigger than 0 in an array code example Example: number of values lager than matlab x=50*rand(7); a= x > 21; numel(a(a>0))