### MX_DIMSET – Set Matrix/Vector dimensions

Block SymbolLicensing group: STANDARD

Function Description
The function block MX_DIMSET sets number rows m of the vector or number of rows m, number of columns n and the leading dimension ld of the matrix referenced by uMV. If any of the inputs m, n, ld is not connected, its original value is retained.

The output cnt contains the actual number of occupied elements of the matrix/vector and is determined by the formula

$\mathtt{\text{cnt}}=\mathtt{\text{ld}}\ast \left(\mathtt{\text{n}}-1\right)+\mathtt{\text{m}}\le \mathtt{\text{amax}}\phantom{\rule{1em}{0ex}},$

where the output amax is the allocated count of matrix/vector elements. If this inequality is fulfilled the output cnt is set to the matrix/vector structure and can be retrieved by the MX_DIM block, otherwise the value of cnt shows the minimum necessary number of elements of the matrix/vector.

The output reference yMV is always set to the corresponding input reference uMV.

The error flag E is set to on if:

• the reference uMV is not defined (i.e. input uMV is not connected),
• the number of rows $\mathtt{\text{m}}<\mathtt{\text{1}}$ or $\mathtt{\text{m}}>\mathtt{\text{ld}}$,
• the number of columns $\mathtt{\text{n}}<\mathtt{\text{1}}$,
• the required number of elements $\mathtt{\text{cnt}}>\mathtt{\text{amax}}$.

Inputs

 uMV Input reference to a matrix or vector Reference m Number of matrix rows Long (I32) ld Leading dimension (>= number of rows) Long (I32)

Outputs

 yMV Output reference to a matrix or vector Reference cnt Count of used matrix/vector elements Long (I32) amax Number of allocated matrix/vector elements Long (I32) E Error indicator Bool

2020 © REX Controls s.r.o., www.rexygen.com