MATLAB: Reducing the number of count/values in each bin in MATLAB

binninghistcounts

Hello,
How can I reduce the no. of values/count that fall into each bin? I am using histcount function
Intervals_CTT = [-100:60]
1) Count_Liquid = (Count_Liquid + histcounts(CTT_liquid, Intervals_CTT))
~ Below is the output of above line. I want to reduce the count, or it can be zero values in the first few bins that would be okay too.
2) Count_Liquid = histcounts(CTT_liquid, Intervals_CTT);
And using the above line (2) I don't get any values in the bins. All the bins contain zero.
Thank you.

Best Answer

In this line:
Count_Liquid = (Count_Liquid + histcounts(CTT_liquid, Intervals_CTT))
the variable Count_Liquid is computed using itself (it appears on both sides). I don't think that's what you want.
Also, the number of elements of CCT_liquid that lie inside a given bin is what it is. The only way to change the counts is to change the bins themselves.
Why not let MATLAB do the binning automatically?
nbins = 200; % number of bins (where more bins => smaller bins => less in each bin)
[Count_Liquid,edges] = histcounts(CTT_liquid, nbins); % get counts and the bin edges