Histogram transformation

transformHistogram transforms a frequency histogram according to a formula specified as an argument.
704 Downloads
Updated 14 Aug 2009

View License

[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
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Histograms in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.1.0.0

The length of the X scale of the transformed histogram was fixed.

1.0.0.0