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;
[Count_Liquid,edges] = histcounts(CTT_liquid, nbins);
Best Answer