# MatrixExpression

The output of this block is a matrix obtained by evaluating the matrix expression specified as a block parameter. The expression specifies the output in terms of input matrices u1,...un where ui is the ith matrix input (except if using custom input names), matrix parameters (defined in the context of the diagram), and constants. Only real matrices are supported.

## Library

MatrixOperations

## Description

The output of this block is a matrix obtained by evaluating the matrix expression specified as block parameter. The expression specifies the output in terms of input matrices u1,...un where ui is the ith matrix input (except if using custom input names), matrix parameters (defined in the context of the diagram) and constants.

Only real matrices are supported. OML functions can be used in the mathematical expression, as long as the value of the function can be determined in the evaluation phase.

Supported syntax is listed as following

Arithmetical operator: + - * / ^

Logical operator: | & ! ~

Relational operator: > < >= <= == ~= <>

Conditional operators: Element-wise if expression, Element-wise switch expression

Matrix operators: [] , ; (,) () : $ :=

Elementary functions: abs exp log log10 min max sign sqrt hypot

Trigonometric functions: acos acosh asin asinh atan atan2 atanh cos cosh sin sinh tan

Rounding functions: ceil floor int round

Matrix functions: eye ones zeros det expm inv logm max min size sum svd

For more details, please refer to the section about Matrix Expression in the Extended Definitions for Advanced Users.## Parameters

Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|

| Number of inputs | Number | ||

| Workspace Evaluation | Hidden parameter used by the block to indicate available environemnt variables. | ||

| Mathematical expression | String | ||

| Use custom input names | Number | 0 | |

| Custom input names | The variable names of inputs. | Structure | |

| Variable name | Input variable name. | Cell of strings | |

| External activation | Number | 0 |

## Ports

Name | Type | Description | IO Type | Number |
---|---|---|---|---|

| explicit | output | 1 | |

| explicit | input | nin | |

| activation | input | externalActivation |

## Advanced Properties

Name | Value | Description |
---|---|---|

| no | |

| yes | |

| no | |

| no | |

| no | |

| no |