compute descriptive statistics on a curve between two X markers, by index in the curve
compute descriptive statistics on a data range, and output to tree.
compute descriptive statistics on points provided as two vectors, and output to tree.
bool curve_stats( double x1, double x2, DWORD dwCntrl, DataPlot & dataplot = NULL )
bool curve_stats( const DataRange & dr, TreeNode & tr )
bool curve_stats( const vector & vx, const vector & vy, TreeNode & tr )
false if no curve found
false if dr is invalid
Returns true.
EX1
void curve_stats_ex1() { //use active plot and output result to Script Window. curve_stats(-10, 10, CUVS_DUMP_SCRIPTWIN); }
EX2
// Before running, make sure one data plot is existed in one active graph window void curve_stats_ex2() { Tree tr; init_input_data_branch_from_selection(tr, DRR_GET_DEPENDENT); // init tree with X, Y tree nodes from the active data plot DataRange dr; dr.Create(); dr.SetTree(tr); //create data range object from tree Tree trReport; curve_stats(dr, trReport); out_tree(trReport); }
EX3
void curve_stats_ex3() { //prepare input data vector vX, vY; vX.Data(1, 10, 1); //fill vector with start = 1, end = 10, interval = 1; vY.Data(0.5, 5.0, 0.5); Tree trResult; if( curve_stats(vX, vY, trResult) ) out_tree(trResult); }
origin.h