Main Content

Integrate C/C++ Code Using S-Function Builder

Integrate your C/C++ code into Simulink® models by creating S-functions automatically

S-function builder is a Simulink block that integrates C/C++ code automatically using the specifications you provide. The S-function builder also serves as a wrapper for the generated S-function in the models that use S-function.

Blocks

S-Function BuilderIntegrate C or C++ code to create S-functions

Functions

expand all

Simulink.SFunctionBuilder.addAdd input, output, parameter, library item, or state to S-Function Builder block (Since R2022a)
Simulink.SFunctionBuilder.updateUpdate attributes for input port, output port, or parameter of S-Function Builder block (Since R2022a)
Simulink.SFunctionBuilder.deleteRemove input, output, parameter, library item, or state from S-Function Builder block (Since R2022a)
Simulink.SFunctionBuilder.setBuildOptionsSet build options for S-Function Builder block (Since R2022a)
Simulink.SFunctionBuilder.setSettingsSet settings for S-Function Builder block (Since R2022a)
Simulink.SFunctionBuilder.setSFunctionNameSet name of S-function for S-Function Builder block (Since R2022a)
Simulink.SFunctionBuilder.setTargetLanguageSet language for S-function generated using S-Function Builder block (Since R2022a)
Simulink.SFunctionBuilder.setUserCodeSet code for methods of S-function generated using S-Function Builder block (Since R2022a)
Simulink.SFunctionBuilder.listList inputs, outputs, parameters, library items, and states for S-Function Builder block (Since R2022a)
Simulink.SFunctionBuilder.getBuildOptionsGet build options for S-Function Builder block (Since R2022a)
Simulink.SFunctionBuilder.getSettingsGet settings for S-Function Builder block (Since R2022a)
Simulink.SFunctionBuilder.getSFunctionNameGet name of S-function generated by S-Function Builder block (Since R2022a)
Simulink.SFunctionBuilder.getTargetLanguageGet language for S-function generated using S-Function Builder block (Since R2022a)
Simulink.SFunctionBuilder.getUserCodeGet code for method of S-function generated using S-Function Builder block (Since R2022a)
Simulink.SFunctionBuilder.buildBuild S-function and generate MEX file for S-Function Builder block (Since R2022a)
Simulink.SFunctionBuilder.generateCodeOnlyBuild S-function without generating MEX file for S-Function Builder block (Since R2022a)
Simulink.SFunctionBuilder.generateFMUGenerate FMU compatible with FMI 3.0 standards from C/C++ code using S-Function Builder block (Since R2023b)

Featured Examples