histo3 [tsa]
HISTO3 calculates histogram and performs data compression

R = HISTO3(Y)
R is a struct with th fields
R.X  are the bin-values
R.H  is the frequency of occurence of value X
R.N  are the number of valid (not NaN) samples

Data compression can be performed in this way
[R,tix] = histo3(Y)
is the compression step

R.tix provides a compressed data representation.
R.compressionratio estimates the compression ratio

R.X(tix) and R.X(R.tix)
reconstruct the orginal signal (decompression)

The effort (in memory and speed) for compression is O(n*log(n)).
The effort (in memory and speed) for decompression is O(n) only.

see also: HISTO, HISTO2, HISTO3, HISTO4

REFERENCE(S):
C.E. Shannon and W. Weaver "The mathematical theory of communication" University of Illinois Press, Urbana 1949 (reprint 1963).