Fcn
Applying the specified expression to the Input.
blockType: Fcn
Path in the library:
|
Description
Block Fcn applies the specified mathematical expression to its Input. The expression may include one or more of these components:
-
— block Input. If — vector, then represents -th element of the vector.
-
Numeric constants.
-
Arithmetic operators (
+−*/^). -
Comparison operators (
==!=><>=⇐) — the expression returns1if the relation is true, otherwise it returns0. -
Logical operators (
&&||!) — the expression returns1if the relation is true, otherwise it returns0. -
Parentheses.
-
Mathematical functions:
abs,acos,asin,atan,ceil,cos,cosh,exp,floor,hypot,log,log10,power,rem,sign,sin,sinh,sqrt,tanandtanh.
In the block Fcn the following rules of operator seniority are observed:
-
() -
^ -
+−(unary) -
! -
*/ -
+− -
><>=⇐ -
==!= -
&& -
||
The Input of a block can be a scalar or a vector. The output always returns a scalar. If the Input of the block is a vector, and the function operates with the input elements separately (for example, the function sin), then the block operates only on the first element of the vector. To get the vector at the output, use the block Math Function.
Ports
Input
#
IN_1
—
Input signal
scalar | vector
Details
An input signal to apply the expression specified in the block parameters.
| Data types |
|
| Complex numbers support |
Yes |
Output
#
OUT_1
—
Output signal
scalar
Details
The output signal calculated by the block. Only a scalar.
| Data types |
|
| Complex numbers support |
Yes |
Parameters
Main
#
Expression —
mathematical expression
String
Details
Specify a mathematical expression to apply to the input data. The components of the expression are listed in the block description. The expression must be mathematically correctly formed (use consistent parentheses, the correct number of function arguments, and so on).
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
Yes |