Fcn
Applying the specified expression to the input.
Description
The Fcn block applies the specified mathematical expression to its input. The expression may include one or more of these components:
-
u is the input of the block. If u is a vector, u[i] represents the i-th element of the vector.
-
Numeric constants.
-
Arithmetic operators (
+
-
*
/
^
). -
Comparison operators (
==
!=
>
<
>=
<=
) - the expression returns1
if the relation is true; otherwise it returns0
. -
Logical operators (
&&&
||
!
) - the expression returns1
if 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
,tan
andtanh
.
The following operator precedence rules are observed in the Fcn block:
-
(
)
-
^
-
+
-
(unary) -
!
-
*
/
-
+
-` -
>
<
>=
<=
-
==
!=
-
&&
-
||
The input of a block can be a scalar or a vector; the output is always a scalar. If the block input is a vector and the function operates on the input elements separately (e.g., the sin function), the block operates only on the first element of the vector. To get a vector at the output, use the block Math Function.
Ports
Parameters
Expression - mathematical expression
mathematical expression
Specify a mathematical expression to apply to the input data. The components of the expression are listed above. The expression must be mathematically correctly formed (use consistent parentheses, correct number of function arguments, and so on).
Block parameter |
|
Values |
|
By default |
`sin(u(1)exp(2.3(-u(2)))) ` |