Compute entropy of vector 'x'


Updated 16 May 2017

View License


H = getEntropy(x,Bins)

Computes the entropy of the vector 'x'. Entropy is computed after
having computed the histogram of the vector, using the binning
defined by 'Bins'.
if Bins is not specified, the function use the default binning as:
Bins = linspace(min(x),max(x),sqrt(numel(x))).


x : original vector (NOT a distribution !!!)
Bins : Binning to use to compute the histogram (optional)


H : Entropy of x (a scalar)

Cite As

Ruggero G. Bettinardi (2023). getEntropy(x,Bins) (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes