function [pos,num]=ent_num_pos(mat,lb,up) % num=ent_num(mat,lb,up) % % Input: mat - a matrix % lb - lower bound % up - upper bound % Output: num -returns the number of entries in mat that are >= lb and <= up. % pos - returns the positions in mat that are >= lb and <= up. % a=mat>=lb & mat<=up; num=sum(a(:)); pos=a;