Finds the discrete histogram of the input sequence X based on the given bin specifications. Details
![]() |
X represents the input data. | ||||||||||||||
![]() |
Bins specifies the boundaries of each bin of the histogram.
The input Bins is an array of clusters where each cluster defines the range of values for a bin. Each cluster contains the following elements:
| ||||||||||||||
![]() |
max specifies the maximum value to include in the histogram. This parameter is optional as explained in the example below. | ||||||||||||||
![]() |
min specifies the minimum value to include in the histogram.
This parameter is optional as explained in the example below.
If max and min are not wired, the VI uses the maximum and minimum values in the input sequence X. |
||||||||||||||
![]() |
# bins specifies the number of bins in the histogram. # bins is optional. # bins is ignored if the Bins input array is not empty. The default behavior is to determine the number of bins according to Sturges' Rule, number of bins = 1 + 3.3log(size of(X)). | ||||||||||||||
![]() |
inclusion specifies how to handle the boundaries of each bin.
If array Bins is not empty, the max, min, # bins, and inclusion parameters are ignored.
|
||||||||||||||
![]() |
Histogram specifies the resulting histogram. | ||||||||||||||
![]() |
Axis specifies the center values for each bin of Histogram.
The centers of each bin are set according to the following equation and returned in the output array Axis.
center[i] = (lower + upper)/2, where lower is the lower boundary of bin i, and upper is the upper boundary of bin i. |
||||||||||||||
![]() |
# outside is the output cluster. outside contains three elements.
| ||||||||||||||
![]() |
error returns any error or warning condition from the VI. |
The VI obtains the Histogram as follows. The VI establishes all the intervals (also called bins) based on the information in the input array Bins first. The intervals (bins) are
= (Bins[i].lower: Bins[i].upper) i = 0, 1, 2,..., k 1
where Bins[i].lower is the value lower in the cluster of array Bins, Bins[i].upper is the value upper in the
cluster of array Bins, k is the number of elements in Bins, which consists of the number of total intervals (bins).
Whether the two ending points Bins[i].lower and Bins[i].upper of each interval (bin) are included in the interval (bin) depends on the value of bin inclusion in the corresponding cluster i of the Bins.
If the array Bins is empty, the VI uses inputs max, min, and # bins to establish the intervals (bins). Each interval (bin) width is the same. Use
to calculate each interval (bin) width . The intervals (bins) are as follows:
if bin inclusion = lower (including lower boundary).
if bin inclusion = upper (including upper boundary).
![]() | Note The first start point min and last end point max are always included in the first and last intervals (Bins). |
After establishing the intervals (Bins), the VI obtains the Histogram using the following formula.
Define the function to be
For example, if x falls into the interval (bin) , then
.
Finally, the VI evaluates the histogram sequence H using
where H represents the elements of the output sequence Histogram, and n is the number of elements in the input sequence X. is the total number of points in the input array X that fall into the interval (bin)
, where i=0,1,...k1. k is the number of bins.