National Instruments 320682C Musical Toy Instrument User Manual


 
Analysis Library Chapter 3
LabWindows/CVI Standard Libraries 3-32 © National Instruments Corporation
Subset1D
int
status =
Subset1D
(double
inputArray
[],
int
numberofElements
,
int
index
,
int
length
,
double
outputArray
[]);
Purpose
Extracts a subset of the
inputArray
input array containing the number of elements specified by
the
length
and starting at the
index
element.
Parameters
Input
inputArray
double-precision
array
Input array.
numberofElements
integer Number of elements in
inputArray
.
index
integer Initial index for the subset.
length
integer Number of elements copied to
the subset.
Output
outputArray
double-precision
array
Subset
array.
Return Value
status
integer Refer to error codes in
Table 3-2.
ToPolar
int
status =
ToPolar
(double
xReal
,
double
yImaginary
,
double
*
magnitude
,
double
*
phaseRadians
);
Purpose
Converts the rectangular coordinates (
xReal
,
yImaginary
) to polar coordinates (
magnitude
,
phaseRadians
). The formulas used to obtain the polar coordinates are as follows.
mag x y=+
22
phase = arctan (y/x)
The
phaseRadians
value is in the range of [ -π to π ]