Simulink Reference    
Math Function

Perform a mathematical function

Library

Math Operations

Description


The Math Function block performs numerous common mathematical functions.

You can select one of these functions from the Function list: exp, log, 10u, log10, magnitude2, square, sqrt, pow, conj, reciprocal, hypot, rem, mod, transpose, and hermitian. The block output is the result of the operation of the function on the input or inputs.

The name of the function appears on the block icon. Simulink automatically draws the appropriate number of input ports.

Use the Math Function block instead of the Fcn block when you want vector or matrix output, because the Fcn block can produce only scalar output.

Data Type Support

A Math Function block accepts complex or real-valued signals or signal vectors of type double. The output signal type is real or complex, depending on the setting of the Output signal type parameter.

Parameters and Dialog Box

Function
The mathematical function.
Output signal type
The dialog allows you to select the output signal type of the Math Function block as real, complex, or auto.


Input
Output Signal Type
Function
Signal
Auto
Real
Complex
Exp, log, 10u, log10, square, sqrt, pow, reciprocal, conjugate, transpose, hermitian
real
complex
real
complex
real
error
complex
complex
magnitude squared
real
complex

real
real

real
real

complex
complex

hypot, rem, mod
real
complex
real
error
real
error
complex
error

Characteristics

Direct Feedthrough
Yes
Sample Time
Inherited from driving block
Scalar Expansion
Of the input when the function requires two inputs
Dimensionalized
Yes
Zero Crossing
No


  Manual Switch MATLAB Fcn