LabWindows/CVI

Content Type
Programming Language
Current manual
Table of Contents

CxUnitVector

Advanced Analysis Library Only

AnalysisLibErrType CxUnitVector (NIComplexNumber inputArray[], ssize_t numberOfElements, int normType, double userdefinedNorm, double *norm);

Purpose

Finds the norm of the complex input array and obtains its corresponding unit vector by normalizing the input array with the norm. CxUnitVector obtains the norm using the following formula:

when normType is 1-norm

when normType is 2-norm

when normType is Inf-norm

when normType is -Inf-norm

when normType is a user-defined value


Where x is the inputArray, y is userdefinedNorm, and ||x|| is norm.

This function calculates the unit vector using the following equation:

Parameters

Input
Name Type Description
numberOfElements ssize_t Number of elements in inputArray.
normType int The norm type to compute. normType must be one of the following values.

Constant Name Constant Value Description
NORM_TYPE_1 0 Compute the 1-norm of inputArray.
NORM_TYPE_2 1 Compute the 2-norm of inputArray.
NORM_TYPE_INF 2 Compute the Inf-norm of inputArray.
NORM_TYPE_NINF 3 Compute the –Inf-norm of inputArray.
NORM_TYPE_USER 4 Compute the user-defined norm.
userdefinedNorm double A user-defined norm type. This function uses this value only when normType is NORM_TYPE_USER. userdefinedNorm must be nonzero.
Output
Name Type Description
inputArray NIComplexNumber [] On input, the complex input array. On output, this parameter returns the corresponding unit vector obtained by normalizing the input array with norm.
norm double The norm of inputArray.

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 2012 and later

Was this information helpful?

Log in to get a better experience

Help us improve your future ni.com experience.

Did you find the documentation you were looking for?

Submit