vectorbase::Trim

Description

Remove all missing values from the vector.

Syntax

bool Trim( )

Parameters

Return

Returns true on success or false on failure.

Examples

EX1

void vectorbase_Trim_ex1()
{
    vector vecData = {0.1, 0.2, 0.3, 0.4};
    vecData[2] = NANUM; // vecData = {0.1, 0.2, NANUM, 0.4}

    vecData.Trim(); // trim missing value from the vector

    for(int ii = 0; ii < vecData.GetSize(); ii++)
        printf("%.1f ",vecData[ii]);
    // Result:
    //        vecData = {0.1, 0.2, 0.4}
}

Remark

Remove all missing values from the vectorbase derived object and resize by shifting data values up.

Note: Trim method for Curve objects causes both X and Y Datasets to be trimmed.

See Also

vectorbase::TrimLeft, vectorbase::TrimRight, vectorbase::GetLowerBound

header to Include

origin.h