Table Of Contents

Unit Vector (G Dataflow)

Last Modified: January 12, 2018

Finds the norm of a vector and normalizes the vector with the norm.

connector_pane_image
datatype_icon

reset

A Boolean that specifies whether to reset the internal state of the node.

True Resets the internal state of the node.
False Does not reset the internal state of the node.

This input is available only if you wire a double-precision, floating-point number to input vector.

Default: False

datatype_icon

input vector

Input vector.

This input can be an array of double-precision, floating-point numbers or an array of complex double-precision, floating-point numbers.

This input changes to input data point when the data type is a double-precision, floating-point number.

If input vector is an empty array, unit vector returns an empty array and norm returns NaN.

datatype_icon

input data point

Input data points.

This input changes to input vector when the data type is a 1D array of double-precision, floating-point numbers or an array of complex double-precision, floating-point numbers.

datatype_icon

norm type

Type of norm this node uses to compute the norm.

This input is available only if you wire an array of double-precision, floating-point numbers or an array of complex double-precision, floating-point numbers to input vector.

Let x represent input vector, y represent user defined norm, and ||x|| represent the norm of the input vector.

Name Value Description
1-norm 1 Calculates norm using the following equation: x = | x 0 | + | x 1 | + + | x n 1 | .
2-norm 2 Calculates norm using the following equation: x = ( | x 0 | 2 + | x 1 | 2 + + | x n 1 | 2 ) .
Inf-norm 3 Calculates norm using the following equation: x = max i ( | x i | ) .
-Inf-norm 4 Calculates norm using the following equation: x = min i ( | x i | ) .
User Defined 5 Calculates norm using the following equation: x = ( | x 0 | y + | x 1 | y + + | x n 1 | y ) 1 y .

Default: 2-norm

datatype_icon

sample length

Length of each set of data.

The node performs computation for each set of data. sample length must be greater than zero.

This input is available only if you wire a double-precision, floating-point number to input vector.

Default: 100

datatype_icon

user defined norm

Value that defines the norm type.

This node uses user defined norm as the norm type only if you set norm type to User Defined. user defined norm must be nonzero.

This input is available only if you wire an array of double-precision, floating-point numbers or an array of complex double-precision, floating-point numbers to input vector.

Default: -1

datatype_icon

error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

datatype_icon

unit vector

Output normalized vector.

This output can return an array of double-precision, floating-point numbers or an array of complex double-precision, floating-point numbers.

datatype_icon

norm

Norm of the input vector.

datatype_icon

error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Algorithm for Calculating unit vector

This node calculates unit vector using the following equation:

U = X X

where U is unit vector.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics