Advanced Analysis Library Only
AnalysisLibErrType Normal1D (double inputVector[], int numberOfElements, double outputVector[], double *mean, double *sDeviation);
Normalizes a 1D input vector. The output vector has the following form:
where mean and sDeviation are the mean and the standard deviation of the input vector.
Refer to StdDev for the formulas Normal1D uses to find the mean and the standard deviation.
Normal1D can perform the operation in place; that is, the input and output arrays can be the same.
/* Generate a vector (1D array) with random samples and normalize it. */
double x[200], y[200], ave, sDev;
int n;
n = 200;
Uniform (n, 17, x);
Normal1D (x, n, y, &ave, &sDev);
Input | ||
Name | Type | Description |
inputVector | double-precision array | Input vector used as the basis for normalization. |
numberOfElements | integer | Number of elements used in the normalization of the input vector. |
Output | ||
Name | Type | Description |
outputVector | double-precision array | Normalized vector. |
mean | double-precision | The mean, or average, value used to normalize the vector. |
sDeviation | double-precision | Standard deviation used to normalize the input vector. |
Name | Type | Description |
status | AnalysisLibErrType | A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants. |