MathExpression
The output of this block is a scalar obtained by evaluating the mathematical expressions specified as block parameters. The expressions are given in terms of variables u1,...un (except if using custom input names) where ui is the ith scalar entry of the unique vector input or the ith scalar input in case the block has more than one input.
Library
MathOperations
Description
The output of this block is a scalar obtained by evaluating the mathematical expressions specified as block parameters. The expressions are given in terms of variables u1,...un where ui is the ith scalar entry of the unique vector input or the ith scalar input in case the block has more than one input.
The expression may also include constant variables as long as they are defined in the diagram workspace. Only scalar operations are allowed between variables and input ui's. Variables however may be OML vectors or matrices; for example if A is an available matrix variable, the operation A(1,1)*u1 is allowed as expression.
Only double data type is allowed. Supported syntax is listed as following
Arithmetical operator: +, -, *, /, ^
Logical operator: |, &, !, ~
Relational operator: >, <, >=, <=, ==, ~=, <>
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 (deprecated), fix, round
Parameters
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
nin | Number of inputs | Number | ||
work | Workspace Evaluation | |||
exx | Mathematical expression | String | ||
zc | Apply zero-crossing | Scalar | 0 | |
useinputnames | Use custom input names | Number | 0 | |
inputnames | Custom input names | The variable names of inputs. | Structure | |
inputnames/inputname | Variable name | Input variable name. | Cell of strings | |
externalActivation | External activation | Number | 0 |
Ports
Name | Type | Description | IO Type | Number |
---|---|---|---|---|
Port 1 | explicit | output | 1 | |
Port 2 | explicit | input | nin | |
Port 3 | activation | input | externalActivation |
Advanced Properties
Name | Value | Description |
---|---|---|
always active | no | |
direct-feedthrough | yes | |
zero-crossing | depends on block parameters | |
mode | depends on block parameters | |
continuous-time state | no | |
discrete-time state | no |