This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

MATLAB Function Block Basics

Integrate MATLAB® functions into Simulink® models

Use MATLAB Function block to implement MATLAB functions to Simulink models to deploy code and embed code in processors. Using MATLAB Function block, you can generate readable, efficient, and compact C/C++ code for deployment to desktop and embedded applications.


MATLAB FunctionInclude MATLAB code in models that generate embeddable C code

Simulink Configuration Parameters


Implementing MATLAB Functions Using Blocks

Add MATLAB functions to Simulink models.

Create Custom Functionality Using MATLAB Function Block

Follow workflow for integrating a MATLAB Function block in a Simulink model.

Resolve Signal Objects for Output Data

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

Create Custom Block Libraries

Create custom block libraries with MATLAB Function blocks.

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.

Integrate C Code Using the MATLAB Function Block

Use MATLAB Function block to call external C code and how to control enumeration and bus typedefs.


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.