Software-in-the-Loop Execution From Command Line

Use software-in-the-loop (SIL) execution to verify the numerical behavior of the generated C/C++ code with reference to your original MATLAB® functions.

To set up and start a SIL execution from the command line:

  1. Create a coder.EmbeddedCodeConfig object.

  2. Configure the object for SIL.

  3. Use the codegen function to generate library code for your MATLAB function and the SIL interface.

  4. Use the coder.runTest function to run the test file for your original MATLAB function.

To terminate the SIL execution, use the clear function_sil or clear mex command.

The following example shows how you can set up and run a SIL execution from the command line.

SIL Execution of Code Generated for a Kalman Estimator

  1.  Copy MATLAB code for Kalman estimator

  2.  Configure SIL execution

  3.  Generate code and run SIL execution

  4.  Debug code during SIL execution

  5.  Terminate SIL execution

Related Examples

More About