Matrices (ESDL)

In ESDL, matrices are available for all basic data types and enumerations and records. The matrix elements are accessed through the matrix indices x and y, the first position for each index is 0.

A matrix can be added and manipulated in the ESDL editor in exactly the same manner as an array. The matrix size cannot be modified at runtime. The maximum size for matrices is 1048576 elements, with not more than 65535 elements per dimension.

The elements of a matrix can be read and written to in ESDL using the following syntax:

val = matrix [indX] [indY];

matrix [indX] [indY] = val;

The first statement assigns the value of the matrix element at position column indX and row indY to the variable val, which must be the same type as the matrix. Since the index count starts from 0, matrix[2][3] returns the third element in the fourth row of the matrix.

The second statement sets the value of the matrix element at position column indX and row indY to val, which must be the same data type as the matrix.

In the context of a project, you can use the Protected Vector Indices option to protect the matrix indices against over- or underflow.

If you want to optimize the generated initialization code of matrices of scalar or enumeration type, activate the Generating Sparse Arrays target option. See also Initialization of Arrays and Matrices.

See also

Public Interface of Matrices

Arrays (ESDL)

Data Editor – Table Editor (Editor for Combined Types)

Project Editor – Code Generation Options

Block Diagram Editor – Creating an Array or Matrix

Initialization of Arrays and Matrices

ASCET Options – Targets Node