Log Binning of Data
This script takes in data, and then produces a logarithmically binned (natural log) histogram:
[midpoints,Freq,eFreq] =logbin(data, BinNum)
where the inputs are
data: the input data from some experiment which will be binned
BinNum: the number of bins used in the data reduction process.
The outputs are:
midpoints := the centre of each log bin
Freq := the number of counts in each bin
eFreq := This calculates the original relative Poissonian error before normalisation, then calculates the new error after normalisation.
One should note that this script is a slightly modified version of
'logbinfromlinbin.m' which can be found here:
http://www-personal.umich.edu/~ladamic/courses/si614w06/matlab/index.html
Modified by LPS July, 2010.
NOTES:
This paper will be of use to some looking more deeply into the technique of using log bins in data reduction
"Sampling, log binning, fitting, and plotting durations of open and shut intervals from single channels and the effects of noise"
by McManus et al. 1987.
Cite As
LPS (2024). Log Binning of Data (https://www.mathworks.com/matlabcentral/fileexchange/27176-log-binning-of-data), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Acknowledgements
Inspired: Estimate pdf of data set spanning orders of magnitude
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.8.0.0 | Made a research article more apparent in the description. |
||
1.7.0.0 | Cleaned up the script, updated the help document within the file - it should be more easily used now. |
||
1.6.0.0 | Realised the information on the usage of the file was severely out of date. This has now been updated. |
||
1.5.0.0 | I have included an error on the Frequency. This calculates the original relative Poissonian error before normalisation, then calculates the new error after normalisation. |
||
1.4.0.0 | Corrected normalisation issue; added better documentation (i.e. request help in CMD window works). |
||
1.3.0.0 | Fixed rounding error which created some extra unnecessary end bins. Also included another output parameter: edges; which some may find useful. |
||
1.2.0.0 | Edit info content |
||
1.1.0.0 | Edited info text |
||
1.0.0.0 |