CStats:Rank
The Rank method computes the rank percentile and standard deviation for a data sample based on the nPercentile value in the data sample. The sample may be a Lua table or a class object of type CImage, CArray, or CMatrix. For CImage and CMatrix objects, an optional CRect object can be used to define the points used in the calculation.
nRank, nStdDev = CStats:Rank( table, nPercentile ) nRank, nStdDev = CStats:Rank( CImage, nPercentile ) nRank, nStdDev = CStats:Rank( CImage, nPercentile, CRect ) nRank, nStdDev = CStats:Rank( CArray, nPercentile ) nRank, nStdDev = CStats:Rank( CArray, nPercentile, CRect ) nRank, nStdDev = CStats:Rank( CMatrix, nPercentile ) where |
table, CImage, CArray, and CMatrix are class objects containing the data to measure,
CRect is a CRect rectangle object that defines the region to measure.
nPercentile is a number in the range 0 through 100.
nRank and nStdDev are rank percentile and standard deviation of the data. On failure, 0,0 is returned.
Suppose that CImage object I and CRect object R exist. The following script returns the value for the 32.5 percentile rank inside a rectangle on the image:
|
-- create a CStats object |
|
-- returns the value at the 32.5 percentile |
|
-- list the results |
The following script returns the 60 percentile rank value in a table of data:
|
-- create a CStats object |
|
-- create some data in a table |
|
-- list the result |