CxUnitVector
- Updated2023-02-21
- 2 minute(s) read
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.
|
||||||||||||||||||
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