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:
Create a coder.EmbeddedCodeConfig
object.
Configure the object for SIL.
Use the codegen
function
to generate library code for your MATLAB function and the SIL
interface.
Use the coder.runTest
function
to run the test file for your original MATLAB function.
To terminate the SIL execution, use the clear
or function
_silclear
mex
command.
The following example shows how you can set up and run a SIL execution from the command line.
Note
Suppose that the MATLAB current working directory (the folder that pwd
displays) is a UNC path
(for example, \\server\a\b\c
) on a Windows platform. If you launch a SIL executable from this path, the
location where the SIL executable is launched can be unpredictable and different
from the MATLAB current working directory (for example,
C:\Windows
).
To fix this issue, use a mapped network drive for the UNC path as your MATLAB current working directory.