Admin Production ni-theme
Current Publication

Normal2D

LabWindows/CVI

Normal2D

Advanced Analysis Library Only

AnalysisLibErrType Normal2D (void *inputMatrix, ssize_t numberOfRows, ssize_t numberOfColumns, void *outputMatrix, double *mean, double *standardDeviation);

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.

The following example uses the Normal2D function.

double inputData[10][10], normalizedData[10][10];
double mean, stdDev;
int i, j, numRows, numCols;
AnalysisLibErrType status;

numRows = 10;
numCols = 10;

/* Use a For loop to generate a 2D array of random numbers between 0.0 and 1.0 */
for (j = 0; j < 10; j++)

for (i = 0; i < 10; i++)

inputData[i][j] = Random(0.0, 1.0);

status = Normal2D(inputData, numRows, numCols, normalizedData, &mean, &stdDev);

Parameters

Input
Name Type Description
inputMatrix void * Input matrix to normalize. This matrix must be an array of doubles.
numberOfRows ssize_t Number of rows used in the normalization of the matrix.
numberOfColumns ssize_t Number of columns used in the normalization of the matrix.
Output
Name Type Description
outputMatrix void * Normalized matrix, as an array of doubles.
mean double The mean, or average, value used to normalize the input matrix.
standardDeviation double 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.

Additional Information

Library: Advanced Analysis Library

Include file: analysis.h

LabWindows/CVI compatibility: LabWindows/CVI 3.1 and later