Subset1D
AnalysisLibErrType Subset1D (double inputArray[], ssize_t numberOfElements, ssize_t index, ssize_t length, double outputArray[]);
Purpose
Extracts a subset of the input array containing the number of elements specified by length and starting at index element. The value of index + length cannot exceed the number of elements.
The following example uses the Subset1D function.
double inputData[10], subsetData[4];
double initialValue, finalValue;
int index, length;
AnalysisLibErrType status;
index = 5;
length = 4;
initialValue = -5.0;
finalValue = 5.0;
// Generate inputData array using the Ramp function
status = Ramp(10, initialValue, finalValue, inputData);
status = Subset1D(inputData, 10, index, length, subsetData);
Parameters
Input | ||
Name | Type | Description |
inputArray | double [] | Input array from which a subset array is extracted. |
numberOfElements | ssize_t | Number of elements in inputArray. |
index | ssize_t | Location in inputArray from which the subset array is extracted. If index + length is greater than numberOfElements, Subset1D returns an error code and does not generate the pattern. Default Value: 0 |
length | ssize_t | Number of elements to include in the subset. If index + length is greater than numberOfElements, Subset1D returns an error code and does not generate the pattern. Default Value: 1 |
Output | ||
Name | Type | Description |
outputArray | double [] | Subset of the input array as specified by index and length. The size of this array must be at least the size of length. |
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: Analysis Library
Include file: analysis.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later