2.1.24.4.23 ocmath_d_running_ave_circular


Description

Calculate pX's every segment's average and SD circularly.

Syntax

int ocmath_d_running_ave_circular( const double * pX, uint nSize, uint nSegmentSize, double * pMeans, double * pSDs, uint nInc = 1 )

Parameters

pX
[input] buffer containing data
nSize
[input] size of pX
nSegmentSize
[input] size of segment
pMeans
[output] buffer containing means
pSDs
[output] buffer containing SDs
nInc
[input] increment

Return

Return number of Means and SDs calculated.

Examples

EX1

void ocmath_d_running_ave_circular_ex1()
{
    Worksheet wks = Project.ActiveLayer();
    wks.SetSize(-1,2);
    DataRange dr;
    dr.Add("X", wks, 0, 0, -1, 0);
    dr.Add("Y", wks, 0, 1, -1, 1);
    
    vector vxData, vyData;
    dr.GetData(&vxData, 0);

    uint nSize = vxData.GetSize();
    uint nSegmentSize = 10;
    vector vMeans, vSDs;
    vMeans.SetSize(nSize);
    vSDs.SetSize(nSize);
    uint nInc = 1;
    int numRet = ocmath_d_running_ave_circular(vxData, nSize, nSegmentSize, vMeans, vSDs, nInc);
}

Remark

See Also

Header to Include

origin.h

Reference