Vector - Dot product

This function block calculates the dot product (also known as scalar product) of the two connected vectors.

The dot product is an operation where the elements of the vectors with the same index are multiplied and these products are added afterwards. The result will be available at output Y.

Both vectors have to have the same length; otherwise the download will be aborted with an error message.

Example

Signals

Name I/O Type(s) Function
VX1 I UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE Input vector 1
VX2 I UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE Input vector 2
Y O UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE Result

Visualization

If the two vectors differ in size, the function block will be depicted red when in run mode.

Comments

The data type will be assigned by connecting an input signal.