- Import your custom C code into Simulink using a C MEX S-Function block.
- Open Simulink Test Manager and create a new test using "Create Test for Model Component".
- Select the option "Perform back-to-back testing".
- Set Simulation 1 to Normal mode to run the Simulink submodel.
- Set Simulation 2 to Software-in-the-Loop (SIL) mode to run your custom C code.
- Make sure your C code setup supports SIL execution (compiled correctly and compatible with Simulink).
- Run the test to automatically compare outputs from both implementations.
How to perform back-to-back Testing of C-custom code in Simulink
5 views (last 30 days)
Show older comments
I am about to use Simulink test for custom C code within simulink. In Simulink model I implemented my submodel and as well I have created its C-source code equivalnt. Now I would like to test my own created code against Simulink submodel.
I am trying to use Simulink test manager for it and configure it for back-to-back testing...
Can I specify and refer to my own code ?

I suppose to run my submodel in parallel with custom C code.
0 Comments
Answers (1)
Shishir Reddy
on 21 Jul 2025
Hi Jack
Kindly refer to the following points to gain understanding on performing back-to-back testing between the Simulink submodel and the custom C code in Simulink Test Manager.
For more information regarding Simulink Test Manager, kindly refer the following documentation - https://www.mathworks.com/help/sltest/ref/simulinktestmanager.html
I hope this helps
0 Comments
See Also
Categories
Find more on Outputs in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!