<< fasthist Huffman Coding Toolbox huffcode >>

Huffman Coding Toolbox >> Huffman Coding Toolbox > histcalc

histcalc

Histogram of a vector or a matrix

Calling Sequence

H=histcalc(x)

Parameters

H:

H is a sparse vector

x:

The vector or matrix x is converted to integer. It must contain only positive values.

Description

The vector or matrix x is converted to integer. A histogram vector with max(x)-Elements is created. Each position J of the vector H contains the number of elements of x, which have the value J.

The execution time is dependent on the different kind of entries of x. It is not mainly dependant on the size of x!

Much faster is the function fasthist !

Examples

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

See also

Authors


Report an issue
<< fasthist Huffman Coding Toolbox huffcode >>