| xyz_examine_data  DescriptionCheck the xyz scatters and return the proposed method for converting the XYZ to matrix Syntax
int xyz_examine_data( UINT nSize, double * x, double * y, double * z, double dPrecision = 1.0e-8, UINT * pVar = NULL, double * pXmin = NULL, double * pXStep = NULL, double * pXmax = NULL, double * pYmin = NULL, double * pYStep = NULL, double * pYmax = NULL, bool bRemoveDuplicate = false, int nMethod = Remove_With_Mean )
 Parameters
    nSize[input] the number of pointsx[input] the X-coordinates of the pointsy[input] the Y-coordinates of the pointsz[input] the Z-coordinates of the pointsdPrecision[input] the precision to determine whether two points are duplicatedpVar[output] the number of points after removing the duplicatespXmin[output] the interval in x-coordinates when scatters are not randomly distributedpXStep[output] the interval in x-coordinates when scatters are not randomly distributedpXmax[output] the maximum in x-coordinates when scatters are not randomly distributedpYmin[output] the minimum in y-coordinates when scatters are not randomly distributedpYStep[output] the interval in y-coordinates when scatters are not randomly distributedpYmax[output] the maximum in y-coordinates when scatters are not randomly distributedbRemoveDuplicate[input] if true, the function will remove the duplicates, or else the array x, y, z will not changenMethod[input] the method used in removing the duplicates Returnexamine result, 0 for regular conversion, 1 for sparse conversion, 2 for random conversion, other value for error. ExamplesEX1 
#include <wks2mat.h>
void xyz_examine_data_ex1()
{
    int n = 10;
    double a[]={1,1,1,2,2,2,3,3,3,2};
    double b[]={1,2,3,1,2,3,1,2,3,2};
    double c[]={5,3,7,3,6,5,0,4,3,7};
 
    int nRet = xyz_examine_data(n, a, b, c, 1.0e-4);
    switch(nRet)
    {
    case Examine_XYZ_Regular:
        out_str("Regular");
        break;
    case Examine_XYZ_Sparse:
        out_str("Sparse");
        break;
    case Examine_XYZ_Random:
        out_str("Random");
        break;
    }
}
RemarkSee Alsoocmath_xyz_examine_data header to Includedwks2mat.h Reference |