User`s guide
18 Coverage Collection During Simulation
18-38
S-Function Using S-Function Builder
1
Copy an instance of the S-Function Builder block from the User-Defined
Functions library in the Library Browser into the your model.
2
Double-click the block to open the S-Function Builder dialog box.
3
On the Build Info tab, select Enable support for coverage.
S-Function Using mex Function
If you use the mex function to compile and link your source files, use the slcovmex
function instead. The slcovmex function compiles your source code and also makes it
compatible with coverage.
This function has the same syntax and takes the same options as the mex function.
In addition, you can provide some options relevant for model coverage. For more
information, see slcovmex.
Generate Coverage Report for S-Function
1
Select Analysis > Coverage > Settings.
2
On the Coverage tab, select Coverage for S-Functions.