Code covered by the BSD License  

Highlights from
Histogram transformation

Be the first to rate this file! 4 Downloads (last 30 days) File Size: 1.91 KB File ID: #25015

Histogram transformation

by Peter Nagy

 

13 Aug 2009 (Updated 14 Aug 2009)

transformHistogram transforms a frequency histogram according to a formula specified as an argument.

| Watch this File

File Information
Description

[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')

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
14 Aug 2009

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

Tag Activity for this File
Tag Applied By Date/Time
histogram transformation Peter Nagy 13 Aug 2009 11:59:28
statistics Peter Nagy 13 Aug 2009 11:59:28
histogram transformation li yuanyuan 06 Sep 2011 02:37:20

Contact us at files@mathworks.com