Main Content
Create MATLAB S-Functions
Create custom blocks with Level-2 MATLAB® S-functions
MATLAB S-function API enables users to use MATLAB language to create custom blocks with the capability of handling multiple input and output ports as well as signals produced by a Simulink® model, including matrix and frame signals of any data type.
Blocks
S-Function | Include S-function in model |
Methods
Classes
Simulink.MSFcnRunTimeBlock | Get run-time information about Level-2 MATLAB S-function block |
Simulink.RunTimeBlock | Allow Level-2 MATLAB S-function and other MATLAB programs to get information about block while simulation is running |
Simulink.BlockData | Provide runtime information about block-related data, such as block parameters |
Simulink.BlockPortData | Describe block input or output port |
Simulink.BlockCompDworkData | Provide post-compilation information about block DWork
vector |
Simulink.BlockCompInputPortData | Provide post-compilation information about block input port |
Simulink.BlockCompOutputPortData | Provide post-compilation information about block output port |
Simulink.BlockPreCompInputPortData | Provide precompilation information about block input port |
Simulink.BlockPreCompOutputPortData | Provide precompilation information about block output port |
Topics
- Write Level-2 MATLAB S-Functions
Explains how to create MATLAB S-functions based on the current Level-2 MATLAB S-function application programming interface (API).
- S-Function Examples
Create various types of S-functions and S-function features.