MATLAB: Loop for counting numbers within specified ranges

countingfrequencyif conditional

Hello, I am trying to create a histogram. I have a vector 2671 values and i want to count the number of values that occur within specified ranges. The code below for some reason, isn't working.
d=0
for i=length(Fine_pearl);
if (Fine_pearl(i,1)>=0.0800) && (Fine_pearl(i,1) <= 0.1)
Fine_pearl(i,1)
d=d+1;
AODF_freq(1,1)=d;
end
end

Best Answer

Why do it yourself? Why not simply call histogram() and pass it the bin edges?
Related Question