Simulink Reference Previous page   Next Page
Fcn

Apply a specified expression to the input

Library

User-Defined Functions

Description


The Fcn block applies the specified C language style expression to its input. The expression can be made up of one or more of these components:

The Fcn block observes the following rules of operator precedence:

  1. ( )
  2. ^
  3. + - (unary)
  4. !
  5. * /
  6. + -
  7. > < <= >=
  8. == !=
  9. &&
  10. ||

The expression differs from a MATLAB expression in that the expression cannot perform matrix computations. Also, this block does not support the colon operator (:).

Block input can be a scalar or vector. The output is always a scalar. For vector output, consider using the Math Function block. If a block is a vector and the function operates on input elements individually (for example, the sin function), the block operates on only the first vector element.

Data Type Support

The Fcn block accepts and outputs signals of type double.

Parameters and Dialog Box

Expression
The C language style expression applied to the input. Expression components are listed above. The expression must be mathematically well formed (i.e., matched parentheses, proper number of function arguments, etc.).
Sample time (-1 for inherited)
Specify the time interval between samples. To inherit the sample time, set this parameter to -1. See Specifying Sample Time in the online documentation for more information.

Characteristics

Direct Feedthrough
Yes
Sample Time
Inherited from driving block
Scalar Expansion
No
Dimensionalized
No
Zero Crossing
No


Previous page  Extract Bits First-Order Hold Next page

© 1994-2005 The MathWorks, Inc.