bins

Am I using histc wrong, or is this MATLAB's fault?

Ok, here's some code in MATLAB: data = [1 1.5 2 3 4 4.5 5 6 7 7 7 0 0 0]; histc(data, [1:1:5]) histc(data, [1:1:5, inf]) histc(data, [-inf, 1:1:5]) which outputs the following: ans = 2 1 1 2 1 ans = 2 1 1 2 5 0 ans = 3 2 1 1 2 1 My question is, why does MATLAB return a useles...

how to make a frequency function in matlab like the excel frequency function?

I have a list that is sorted and I want to know how many values are in each bin? I made bins using linspace(floor(fist_element_list), ceil(last_element_list), num_bins) Is there a built in function or an easy way to do this in Matlab? All I can think of is doing it manually. I would like a frequency function like the one in excel. ...