Admin Production ni-theme
Current Publication

QScale1D

LabWindows/CVI

QScale1D

Advanced Analysis Library Only

AnalysisLibErrType QScale1D (double inputArray[], ssize_t numberOfElements, double outputArray[], double *scalingFactor);

Purpose

Finds the maximum absolute value in the array and produces a scaled array. QScale1D can obtain the ith element of the scaled array using the following formula:

where scalingFactor is the maximum absolute value in the input array.

QScale1D determines the constant scale.

Use this function instead of Scale1D, particularly if the expected mean value is 0. QScale1D can perform the operation in place; that is, the input and output arrays can be the same.

The following example uses the QScale1D function.

double inputData[10], scaledData[10];
double scalingFactor;
AnalysisLibErrType status;

// Generate an array of random numbers
status = Uniform (10, 17, inputData);

status = QScale1D(inputData, 10, scaledData, &scalingFactor);

Parameters

Input
Name Type Description
inputArray double [] Input array used as the basis for quick scaling.
numberOfElements ssize_t Number of elements used to scale the input array.
Output
Name Type Description
outputArray double [] Scaled array.
scalingFactor double Maximum absolute value in the input array.

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