Scilab Function
Last update : 06/02/2007

fasthist - fast calculation of histogram

Calling Sequence

H = fasthist(A)

Parameters

Description

The function fasthist uses sparse functions to calculate the histogram in a single step. No while loops are needed. The matrix A may contain positive numbers larger or equal 1.

//The result vector h (sparse) represents the histogram, that means the number of occurences of elements of the vector A. H has the length max(int(a)).

Examples

// Generate a Testmatrix
A=testmatrix('frk',10)+1;
H1=fasthist(A);
// Now, we add a constant to A...
// let us see, what happens
H2=fasthist(A+6);
disp(H1);
disp(H2);
// End of Example

See Also

huffman ,   huffcode ,  

Authors

Dr. Andreas Geisslergeisslea@web.de