Normal2D

Advanced Analysis Library Only

AnalysisLibErrType Normal2D (void *inputMatrix, int numberRows, int numberColumns, void *outputMatrix, double *mean, double *sDeviation);

Purpose

Normalizes a 2D input matrix. The output matrix has the following form:

where mean and sDeviation are the mean and the standard deviation of the input matrix.

Refer to StdDev for the formulas Normal2D uses to find the mean and the standard deviation.

Normal2D can perform the operation in place; that is, the input and output arrays can be the same.

Example

/* Normalize a matrix (2D array). */
double x[10][20], y[10][20], ave, sDev;
int n, m;
n = 10;
m = 20;
.
.
.
Normal2D (x, n, m, y, &ave, &sDev);

Parameters

Input
Name Type Description
inputMatrix numeric array Input matrix to normalize. This matrix must be an array of doubles.
numberRows integer Number of rows used in the normalization of the matrix.
numberColumns integer Number of columns used in the normalization of the matrix.
Output
Name Type Description
outputMatrix numeric array Normalized matrix, as an array of doubles.
mean double-precision The mean, or average, value used to normalize the input matrix.
sDeviation double-precision Standard deviation used to normalize the input matrix.

Return Value

Name Type Description
status AnalysisLibErrType A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants.