Admin Production ni-theme
Current Publication

Clip

LabWindows/CVI

Clip

Advanced Analysis Library Only

AnalysisLibErrType Clip (double inputArray[], ssize_t numberOfElements, double upperLimit, double lowerLimit, double outputArray[]);

Purpose

Clips each element of the array between the specified upper and lower limits.

Clip obtains the ith element of the resulting array using the following formula:

If upperLimit is less than lowerLimit, Clip returns an error code. This operation can be performed in place; that is, the input and output arrays can be the same.

The following example uses the Clip function.

double inputData[10], clippedData[10];
double lowerLimit, upperLimit;
AnalysisLibErrType status;

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

status = Clip (inputData, 10, upperLimit, lowerLimit, clippedData);

Parameters

Input
Name Type Description
inputArray double [] Input array whose values are clipped.
numberOfElements ssize_t Number of elements in to clip.
upperLimit double Upper limit for the clipping operation. Array elements greater than this value are set equal to this value.

Default Value: 1.0.
lowerLimit double Lower limit for the clipping operation. Array elements less than this value are set equal to this value.

Default Value: 0.0.
Output
Name Type Description
outputArray double [] Clipped 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