Histogram transformation
[transformedHistogram,newX]=transformHistogram(originalHistogram,originalX,formula)
transformHistogram transforms the histogram stored in the 1D array 'orignalHistogram' according to the formula 'formula'.
'originalHistogram' is defined at bins stored in 'orignalX'.
The output 'transformedHistogram' contains the transformed histogram at the same bins as the originalHistogram.
The histogram is assumed to be stored according to the following principle:
f(X(i)) = frequency (X(i)<lambda<=X(i+1))
f(X(end) = frequency (lambda=X(end))
This is the principle how histc generates its output.
The best is if f(end)=0
'formula' has to be a string containing the transformation rules. The variable has to be x, e.g. 2x+3
Example: transformHistogram(starved,xscale,'x.^2')
Cite As
Peter Nagy (2024). Histogram transformation (https://www.mathworks.com/matlabcentral/fileexchange/25015-histogram-transformation), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
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.