The function has no menu option and can only called programmatically.
Average or concatenate multiple curves with option to customize output
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
Input | iy |
Input XYRange |
|
Specifies multiple curves to be averaged or concatenated. |
Method | method |
Input int |
|
Average Method
Option list:
|
Averaged X | avex |
Input int |
|
This is available only when Average is selected for Method. It specifies the method to determine the X values of the averaged curve.
Option list:
|
Tolerance for Common X Values | toler |
Input double |
|
This is available only when Average is selected for method and same is selected for avex. It is used to check if the X values of input curves are the same. |
Number of Points | npts |
Input int |
|
This is available when Average is selected for Method and Averaged X is not set to Same as Source X. It specifies the number of points of the interpolated curves. In the dialog box, it computes a number automatically if Auto is checked. You can also uncheck Auto and specify the values directly. |
X Minimum | xmin |
Input double |
|
This is editable only when Custom is selected for Average X. It specifies the minimum X value of the averaged curve. In the dialog box, it computes a number automatically if Auto is checked. You can also uncheck Auto and specify the values directly. This variable is read-only if Common X Range or Full X Range is selected for Averaged X. |
X Maximum | xmax |
Input double |
|
This is editable only when Custom is selected for Average X. It specifies the maximum X value of the averaged curve. In the dialog box, it computes a number automatically if Auto is checked. You can also uncheck Auto and specify the values directly. This variable is read-only if Common X Range or Full X Range is selected for Averaged X. |
Interpolate | interp |
Input int |
|
This is available only when Average X is not set to Same as Source X. It specifies the method to interpolate the Y values when averaging the input curves.
Option list:
|
No Extrapolation | extrap |
Input int |
|
This is available only when Averaged X is not set to Full X Range, Custom, and Follow Curve Trace. It is used to specify whether to extrapolate the curves when these curves have different X ranges. |
Sort X | sortx |
Input int |
|
It is available only when Concatenate is selected for Method. It specifies the method to sort the X values of the averaged curve. Y values will be reordered accordingly.
Option list:
|
X | x |
Output vector |
|
Specifies the column for output averaged X values. |
Y | y |
Output vector |
|
Specifies the column for output averaged Y values. |
Std Dev | sd |
Output vector |
|
This variable is available only when the Method is set to Average. It specifies whether or not to compute the standard deviations of the averaged curve. |
Std Err | se |
Output vector |
|
This variable is available only when the Method is set to Average. It specifies whether or not to compute the standard errors of the averaged curve. |
N | n |
Output vector |
|
This variable is available only when the Method is set to Average. It specifies whether or not to compute the counts of input data points that correspond to each averaged X value. |
Minimum | min |
Input int |
|
This variable is available only when the Method is set to Average. It specifies whether or not to output the minimum value. |
Maximum | max |
Input int |
|
This variable is available only when the Method variable is set to Average. It specifies whether or not to output the maximum value. |
Minimum | min |
Input int |
|
This variable is available only when the Method is set to Average. It specifies whether or not to output the minimum value. |
SD times 2 | sd2 |
Input int |
|
This variable is available only when the Method variable is set to Average. It specifies whether or not to compute the standard deviation times 2. |
SD times 3 | sd3 |
Input int |
|
This variable is available only when the Method variable is set to Average. It specifies whether or not to compute the standard deviation times 3. |
This function calculates the average of the input curves or concatenates them, and then outputs the X, Y value as vectors, along with any other selected outputs.
If the Method variable is set to Concatenate, the input ranges will be joined to form a larger data set. Otherwise, the averaged Y values for the input curves will be computed.
The interpolation is performed on all the input curves' y values on a uniform X range for the averaged curve. Or, you can simply join the x values of all the input curves to form a larger data set. In this case, you can specify a tolerance and the minor differences in x values are ignored.
If x values of input curves are not monotonic, the curves are sorted first and then Origin averages these monotonic curves. For average computation, the standard deviations, standard errors and number of points that correspond to each X value can be also output.
The following script command is used to average two curves data in the active worksheet using linear interpolation on the X values.
averagexy iy:=((col(1),col(2)),(col(3), col(4))) method:=ave avex:=common x:=<new> y:= <new>;
Then two columns are added to the input worksheet. One stores the x values and other stores the y values of the averaged curve.
When the Method variable is set to Concatenate, all the input ranges are simply joined together. Otherwise, average Y values are computed for the input curves. For computing the X values of the averaged curve, this X-Function provides five methods.
For more information about the method of computing the x values, please refer to the algorithm of avecurves.