Using Simulink    
MATLAB Fcn

Apply a MATLAB function or expression to the input.

Library

Functions & Tables

Description

The MATLAB Fcn block applies the specified MATLAB function or expression to the input. The output of the function must match the output dimensions of the block or an error occurs.

Here are some sample valid expressions for this block.

Data Type Support

A MATLAB Fcn block accepts one complex- or real-valued input of type double and generates real or complex output of type double, depending on the setting of the Output signal type parameter.

Parameters and Dialog Box

MATLAB function
The function or expression. If you specify a function only, it is not necessary to include the input argument in parentheses.
Output dimensions
The output dimensions. If the output dimensions are to be the same as the input dimensions, specify -1. Otherwise, you must specify the correct dimensions or an error will result.
Output signal type
The dialog allows you to select the output signal type of the MATLAB Fcn as real, complex, or auto. A value of auto sets the block's output type to be the same as the type of the input signal.
Collapse 2-D results to 1-D
Outputs a 2-D array as a 1-D array containing the 2-D array's elements in column-major order.

Characteristics

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


 Math Function Matrix Concatenation