Matrix

A matrix (type symbol ) is a two-dimensional, indexed set of elements which have the same scalar or enumeration or record data type. The type of index for each dimension is the same as that of an array, i.e. a non-negative integer. The total size of a matrix is limited to 1048576 elements. The size of each axis is limited to max. 65535, and the product of the axes sizes must not exceed the total size limit. The indices take values between 0 and size ‑ 1.

Note

You cannot edit the data of a matrix with one or both axes larger than 63 in the table editor. Instead, proceed as described in Editing Data of a Large Array or Matrix.

The interface of a matrix used as variable consists of the following methods:

The interface of a matrix used as parameter consists of the methods getat(i, j), xLength() and yLength().

The interface of a matrix used as message depends on the message type.

Message type

Send

Receive

Send & Receive

setAt(a, i, j)

+

+

getAt(i, j)

+

+

xLength()

+

+

+

yLength()

+

+

+

Note

Matrices of record type can be exported only in AMD format V6.4.3 and higher, matrices of enumeration type can be exported only in AMD format V6.4.2 and higher.

A matrix with one or both axes larger than 63 can be exported only in AMD format V6.4.3 and higher.

Older AMD formats will result in an export error.

Matrices of non-scalar basic types or complex (user-defined) types other than records are not available.

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

You can use the Generating Sparse Arrays target option to optimize the generated initialization code for matrices of scalar or enumeration type; see Initialization of Composite Elements.

See also

Editing Data of a Large Array or Matrix (Data Editor)

Editing an Array or Matrix (Data Editor)

Arrays and Matrices of Record Type – Special Features

Variant Size for Arrays and Matrices

Variable Size for Arrays and Matrices

Initialization of Composite Elements

Arrays and Matrices (Block Diagrams)

Arrays (ESDL)

Matrices (ESDL)

Arrays and Matrices in C Code

Messages

ASCET Options – Targets Node

Project Editor – Code Generation Options