Matrix - Addition of matrices

Symbol:

Description:

This function block will add two matrices with each other.

Every element of input matrix MX2 will be added to the appropriate element of MX1. The result will be available at MX1.

Both matrices have to have the same number of rows and columns; otherwise the download will be aborted with an error message.

Signals:

Name

I/O

Type(s)

Function

MX1

I/O

UCHAR,WORD, LONG, LONGLONG, FLOAT, DOUBLE

In-/output matrix

MX2

I

UCHAR,WORD, LONG, LONGLONG, FLOAT, DOUBLE

Input matrix

Visualization:

If the two matrices differ in their dimensions, the function block will be depicted red when in run mode.

Comments:

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


Matrix - Addition with scalar

Symbol: |
Description: | This function block adds the value of input x to every element of matrix MX. The result will be written back to MX.
Signals: | Name | I/O | Type(s) | Function
 | MX | I/O | UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE | In-/output vector
 | x | I | UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE | Summand
Comments: | The data type will be assigned by connecting an input signal.


Matrix – Multiplication of matrices

Vector/Matrix numeric operations

Matrix - Multiplication of matrices

Symbol:

Description:

This function block will multiply the matrices MX1 and MX2 with each other.

The matrix multiplication is an operation where the elements of the rows of MX1 are multiplied with the elements of the columns of MX2 and these products are added afterwards.

This operation can only be accomplished, if the dimensions of the matrices are in an appropriate ratio to each other. An m*k matrix can only be multiplied with a k*n matrix. The result is an m*n matrix.

The result matrix will either be written to matrix MX3 or a new matrix will be created at output MY.

No designated output matrix (default):

The result will be write back to the additional in-/output matrix MX3. No new matrix will be created. The output MY will not be available. The provided matrix MX3 has to be large enough to hold the result of the matrix multiplication of MX1 and MX2. If this is not the case the download will be aborted with an error message.

With designated output matrix:

A new matrix will be created on MY. The dimension of this matrix will be determined automatically out of the input matrices. The input MX3 is not available.

Example:

Parameter:

The parameter dialog can be used to select the way how to provide the calculated matrix.

Signals:

Name

I/O

Type(s)

Function

MX1

I

UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE

Input matrix

MX2

I

UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE

Input matrix

MX3

I/O

UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE

In-/output matrix

MY

O

UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE

output matrix

Visualization:

If the input signals are connected incorrectly, the symbol will be depicted red in run mode.

Comments:

An input matrix connected to MX1 or MX2 is not allowed to be connected at MX3 as the result matrix!

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


Matrix – Multiplication with scalar

Vector/Matrix numeric operations

Matrix - Multiplication with scalar

Symbol: |
Description: | This function block will multiply every element of the matrix MX by the input value x. The result will be written back to MX.
Signals: | Name | I/O | Type(s) | Function
 | MX | I/O | UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE | In-/output matrix
 | x | I | UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE | Factor
Comment: | The data type will be assigned by connecting an input signal.


Matrix - Sort

Symbol: |
Description: | This function block will sort the connected matrix MX. The rows or the columns of the matrix can be sorted in downward or upward order. The sorting direction will be determined by the input bAscend. The input KeyInd defines the index of the key row or column to be sorted. If the rows will be sorted KeyInd indicates a column, otherwise it indicates a row. The result will be written back to MX.
Operation: | bAscend = HIGH: bAscend = LOW: |  |  | Ascending order Descending order
Parameter: | The parameter dialog can be used to select whether the rows or the columns of the matrix will be sorted.
Signals: | Name | I/O | Type(s) |  | Function
 | MX | I/O | UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE |  | In-/output matrix
 | bAscend | I | BIT |  | Sorting direction
 | KeyInd | I | WORD |  | Key row or column
Visualization: | An indication of the operation mode will be shown in the symbol.
Comments: | The first row/column of the matrix has the index of 0. The data type will be assigned by connecting the input signal MX.


Vektor - Addition of vectors

Vector/Matrix numeric operations

Vector - Addition of vectors

Symbol:

Description:

This function block will add two vectors.

Every element of input vector VX2 will be added to the appropriate element of VX1. The result will be available at VX1.

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

Signals:

Name

I/O

Type(s)

Function

VX1

I/O

UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE

In-/output vector

VX2

I

UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE

Input vector

Visualization:

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

Comments:

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


Vector - Addition with scalar

Vector/Matrix numeric operations

Vector – Addition with scalar

Symbol: |
Description: | This function block will add the value of the input x to every element of vector VX. The result will be written back to VX.
Signals: | Name | I/O | Type(s) | Function
 | VX | I/O | UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE | In-/output vector
 | x | I | UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE | Summand
Comments: | The data type will be assigned by connecting an input signal.


Vector – Dot product

Symbol:

Description:

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 the size, the function block will be depicted red when in run mode.

Comments:

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


Vektor - Element index

Vector/Matrix numeric operations

Vector – Element index

Symbol:

Description:

This function blocks determines the index of an element of the vector VC with a given value x.

The vector will be searched beginning from index Ind. The index of the first match will be assigned to output xPos. If no match can be found -1 is given at the output.

For the data types FLOAT and DOUBLE the additional input Tol appears. Here it is possible to define a tolerance for the search.

Signals:

Name

I/O

Type(s)

Function

VX

I

UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE

Input vector

x

I

UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE

Search value

Ind

I

WORD

Starting index

Tol

.I

FLOAT, DOUBLE

Tolerance

xPos

O

WORD

Index of the value or -1

Comments:

The vector starts with the index 0.

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


Vektor - Multiplication with scalar

Vector/Matrix numeric operations

Vector - Multiplication with scalar

Symbol: |
Description: | This function block will multiply every element of the vector VX by the input value x. The result will be written back to VX.
Signals: | Name | I/O | Type(s) | Function
 | VX | I/O | UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE | In-/Output vector
 | x | I | UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE | Factor
Comments: | The data type will be assigned by connecting an input signal.


Vektor – Rank of value

Vector/Matrix numeric operations

Vector – Rank of value

Symbol:

Description:

This function block determines the rank of the value x within the given vector VX.

This means the potential position of the value will be determined, as if this value would be inserted. To get meaningful results a sorting of the input vector is presumed and the sorting order has to be given.

If the position of the value would have been beyond the last element of the vector, the result will be set to the last index, but the output bOoR (Out of Range) will be set to HIGH, otherwise this output is LOW.

Operation:

bAscend = HIGH:

bAscend = LOW:

Ascending order given

Descending order given

Signals:

Name

I/O

Type(s)

Function

VX

I

UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE

Input vector

x

I

UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE

Input value

bAscend

I

Bit

Sorting order

bOoR

O

Bit

Overflow flag

xPos

O

WORD

Index within the vector

Comments:

The vector starts with the index 0.

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


Vektor - Sortieren

Vector/Matrix numeric operations

Vector - Sort

Symbol: |
Description: | This function block sorts the elements of the vector VX in ascending or descending order. The order will be determined by the input bAscend. The result will be written back to VX.
Operation: | bAscend = HIGH: bAscend = LOW: |  |  | Ascending order Descending order
Signals: | Name | I/O | Type(s) |  | Function
 | VX | I/O | UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE |  | In-/output vector
 | bAscend | I | BIT |  | Sorting direction
Comments: | The data type will be assigned by connecting the input signal VX.