Integrate C/C++ Code Using Code Importers
Choose the appropriate importer based on your requirements.
If you have one simple C function and its Simulink implementation does not require states, use C Caller block.
If you want to integrate multiple C functions, use C Function block when its Simulink implementation:
Requires the function to be called conditionally
Does not require states
Requires discrete states retained for a single time step
Requires preprocessing and postprocessing of data
If you want to create a Simulink library of C Caller blocks from your C/C++ code using a simple wizard, use the Simulink Code Importer.
Categories
- Integrate C Code Using C Caller Blocks
Call simple external C code into Simulink by importing C functions
- Integrate C/C++ Code Using C Function Blocks
Integrate and call external C/C++ code from a Simulink model
- Create Block Library from C/C++ Code
Create Simulink libraries from C/C++ code with the Simulink Code Importer