Writing S-Functions    

Setting the Include Path

The S-Function Builder searches for custom header files in the directories specified by the MATLAB application data named SfunctionBuilderIncludePath. This data is associated with the model in which you create the S-Function Builder block. If your S-function uses custom header files and the custom header files do not reside in the current directory (i.e., the directory containing the generated S-function), you must update SfunctionBuilderIncludePath to specify the locations of the directories containing the header files. SfunctionBuilderIncludePath is a three-element cell array that allows you to specify as many as three include directories. For example, the following MATLAB commands set SfunctionBuilderIncludePath to the paths of two include directories.


  S-Function Builder Dialog Box Example of a Basic C MEX S-Function