MATLAB: Best way to find a count in a range of numbers

array

If I have a desired range of numbers, what is the best way to search the occurances of numbers that fall into this range? Currently I do something like this:
for i=1:length(data)
index=data(i)<lowerbound | data(i)>upperbound;
for j=1:length(data)
data(index)=[];
end
end
Is there a better way than is?

Best Answer

index=data<lowerbound | data>upperbound;
data(index)=[];