Click or drag to resize

IMcOMGlobalMcVectorHistogram Method

Computes a histogram of the values in an array. The number of bins, the starting value and the size of a bin are user-specified.

Namespace:  MediaCy.IQL.ObjectManager
Assembly:  MediaCy.IQL.ObjectManager (in MediaCy.IQL.ObjectManager.dll) Version: 10.0.6912.0
Syntax
VB
Function McVectorHistogram ( 
	Operand As Object,
	lNofBins As Integer,
	varBinStartAndSize As Object
) As McObject

Parameters

Operand
Type: SystemObject
Array of values to compute the histogram for.
lNofBins
Type: SystemInt32
Number of bins (N) to create for the histogram.
varBinStartAndSize
Type: SystemObject
Length-2 array of the same type of as Operand, giving the StartValue and BinSize values for the histogram. The StartValue is the smallest value to be counted in the zero'th (first) bin; values less than StartValue are not counted. BinSize sets the size of each bin; values greater than or equal to StartValue+N*BinSize fall beyond the (N-1)'th (last) bin and are not counted.

Return Value

Type: McObject
A McObject of type mcobjTypeINTEGER holding an array of length-N (lNofBins of bins) containing a histogram of the values of Operand.
Remarks
The index of the bin to be incremented for any Value is computed as: Index=CLng((Value-StartValue)/BinSize), where the cast to an integral index truncates rather than rounds the result of the division.
Examples
VB
'Create a 10-bin histogram of the numbers from 1 to 100
Dim mcoT As McObject
Set mcoT = McOpCast(McOpFillIn(1, 101), "REAL") 'numbers from 1.0 thru 100.0
Dim mcoH As McObject
Set mcoH = McVectorHistogram(mcoT, 10, Array(1, 10))
Debug.Print "Bin Counts = " & McToText(mcoH) 'same count in each bin
See Also