Subset1D

AnalysisLibErrType Subset1D (double inputArray[], int numberOfElements, int index, int 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.

Example

/* The following example generates y = {0.0, 1.0, 2.0, 3.0}. */
double x[11], y[4], first, last;
int n, index, length;
n = 11;
index = 5;
length = 4;
first = -5.0;
last = 5.0;
Ramp (n, first, last, x);
Subset1D (x, n, index, length, y);

Parameters

Input
Name Type Description
inputArray double-precision array Input array from which a subset array is extracted.
numberOfElements integer Number of elements in inputArray.
index integer 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 integer 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-precision array 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.