Find the most bin. This is an OriginPro only function.
USHORT ocmath_us_find_most( USHORT * pData, uint nSize, uint nBins, double * pRatio = NULL )
the most bin's area
EX1
void ocmath_d_find_most_ex1() { Worksheet wks = Project.ActiveLayer(); wks.SetSize(-1,3); DataRange dr; dr.Add("Y", wks, 0, 1, -1, 1); vector vecData; dr.GetData(&vecData, 0); uint nSize = vecData.GetSize(); uint nBins = nSize/2; double pRatio; double dmost=ocmath_d_find_most(vecData,nSize,nBins, &pRatio); }
Find the most bin, which includes most datas of pData, by dividing pData into nbins.
Then, calculate pRatio, pRatio = uMax / dTotal where uMax is the most bin's frequence,
dTotal is the sum of all bins' frequence.
Data types supported:
origin.h