Admin Production ni-theme
Current Publication

Triangle

LabWindows/CVI

Triangle

Advanced Analysis Library Only

AnalysisLibErrType Triangle (ssize_t numberOfElements, double amplitude, double triangle[]);

Purpose

Generates an output array that has a triangular pattern. Triangle obtains the ith element of the double-precision output array using the following formulas:

Example Code

/* The following code generates the pattern tri = {0.0, 1.0, 2.0, 3.0, 4.0, 3.0, 2.0, 1.0}. */
double tri[8], amp;
int n;
n = 8;
amp = 4.0;
Triangle (n, amp, tri);

Parameters

Input
Name Type Description
numberOfElements ssize_t Number of elements to generate in the triangular pattern.
amplitude double Peak amplitude of the triangular pattern.

Default Value: 1.0.
Output
Name Type Description
triangle double [] Generated triangular pattern.

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