Documentation

MATLAB Algorithm Integration

Integrate MATLAB® algorithms in Simulink® models with MATLAB Function blocks

Blocks

MATLAB FunctionInclude MATLAB code in models that generate embeddable C code

Simulink Configuration Parameters

Topics

What Is a MATLAB Function Block?

Add MATLAB functions to Simulink models.

Type Function Arguments

Specify argument types for the top-level function in a MATLAB Function block.

Size Function Arguments

Specify argument sizes for the top-level function in a MATLAB Function block.

Units in MATLAB Function Blocks

Specify, visualize, and check consistency of units on MATLAB Function block interfaces.

Add Parameter Arguments

Pass Simulink parameters and MATLAB variables as arguments to a MATLAB Function block.

Resolve Signal Objects for Output Data

Manage implicit signal resolution at various levels of the model hierarchy.

MATLAB Function Block Editor

Edit MATLAB Function block code. Define data arguments, input triggers, and function-call outputs for a MATLAB Function block.

Track Object Using MATLAB Code

Integrate MATLAB code into a Simulink model that estimates the position of an object moving in a two-dimensional space.

Filter Audio Signal Using MATLAB Code

Integrate MATLAB code into a Simulink model for a signal processing application.

Create Custom Block Libraries

Create custom block libraries with MATLAB Function blocks.

Use Nondirect Feedthrough in a MATLAB Function Block

Disable direct feedthrough to use MATLAB Function blocks in a feedback loop.

Troubleshooting

Debugging a MATLAB Function Block

Debug a MATLAB Function block function during simulation and check for data range violations.

Prevent Algebraic Loop Errors in MATLAB Function and Stateflow Blocks

Adhere to restrictions for using MATLAB Function blocks, Stateflow® charts, and Truth Tables in feedback loops.

Was this topic helpful?