Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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 Apply specified expression to input
Function Caller Call Simulink or exported Stateflow functionFunction defined with Simulink blocks
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 Create S-function from C code that you provide
Simulink Function Call Simulink or exported Stateflow functionFunction 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?