matrixbase::GetMin

Description

Get the minimum cell value in the matrix (as a double).

Syntax

double GetMin( )

Parameters

Return

Returns the minimum cell value in the matrix (as a double).

Note that the missing values in the matrix are excluded from the computation.

Examples

EX1

// Compute the minimum value of cells of a matrix
void matrixbase_GetMin_ex1()
{
    matrix<double> mat1 = {
        {-1,  0,  1},
        { 2,  3,  4}
    };
    // Output of this program will be like following:
    //   The minimum value of cells in Matrix1 is: -1 .
    
    MatrixPage MatPg1;
    MatPg1.Create("Origin");
    MatrixLayer MatLy1 = MatPg1.Layers(0);
    Matrix Mat1(MatLy1);
    Mat1 = mat1;

    double dMin;
    dMin = Mat1.GetMin();  // Compute the minimum value by GetMin
    printf("  The minimum value of cells in %s is: %g .\n",
      Mat1.GetName(), dMin);
}

EX2

// Compute the minimum value of cells of a matrix including NANUMs
void matrixbase_GetMin_ex2()
{   
    matrix<double> mat1 = {
        {99, 0, 1},
        { 2, 3, 4}
    };
    mat1[0][0]=NANUM;  // set row=1,col=1 to NANUM
    // Input matrix is:
    //  {--,  0,  1}
    //  { 2,  3   4}
    //
    //   Output of this program will be like following:
    //   The minimum value of cells in Matrix1 is: 0 .
    
    MatrixPage MatPg1;
    MatPg1.Create("Origin");
    MatrixLayer MatLy1 = MatPg1.Layers(0);
    Matrix Mat1(MatLy1);
    Mat1 = mat1;

    double dMin;
    dMin = Mat1.GetMin();  // Compute the minimum value by GetMin
    printf("  The minimum value of cells in %s is: %g .\n",
      Mat1.GetName(), dMin);
}

Remark

Return the minimum cell value in the matrix (as a double). Note that the missing values in the matrix are excluded from the computation.

See Also

matrixbase::GetMax, matrixbase::GetMean, matrixbase::GetMedian

header to Include

origin.h