function num=ent_num(mat,lb,up) % num=ent_num(mat,lb,up) % % Input: mat - a matrix % lb - lower bound % up - upper bound % Output: returns the number of entries in mat that are >= lb and <= up. % a=mat>=lb & mat<=up; num=sum(a(:)); fprintf('Number of entries greater than %d and less than %d is %d \n',lb,up,num);