Documentation

Block Creation Basics

Create custom blocks to extend modeling functionality

Custom blocks expand the modeling functionality provided with Simulink®. Use a custom block to:

  • Model behaviors that are not provided with a Simulink built-in solution.

  • Build more advanced models.

  • Encapsulate model components into a library block that you can copy into multiple models.

  • Provide custom user interfaces or analysis routines.

Blocks

Fcn 应用specified expression to input
Function Caller Call Simulink or exported Stateflow function
Interpreted MATLAB Function Apply MATLAB function or expression to input
Level-2 MATLAB S-Function Use Level-2 MATLAB S-function in model
MATLAB Function Include MATLAB code in models that generate embeddable C code
MATLAB System Include System object in model
S-Function Include S-function in model
S-Function Builder Integrate C or C++ code to create S-functions
万博1manbetx仿真软件的功能 Function defined with Simulink blocks

Examples and How To

Create a Custom Block

Step-by-step example of building a custom block.

Concepts

Create Your Own Simulink Block

Create custom blocks for Simulink.

Comparison of Custom Block Functionality

List of features provided by different custom blocks types.

Expanding Custom Block Functionality

How to use callbacks and MATLAB®graphics to add functionality to custom blocks.

Was this topic helpful?