Writing S-Functions    

S-Function RTWdata

There is a property of blocks called RTWdata, which can be used by the Target Language Compiler when inlining an S-function. RTWdata is a structure of strings that you can attach to a block. It is saved with the model and placed in the model.rtw file when generating code. For example, this set of MATLAB commands,

produces this result:

Inside the model.rtw file for the associated S-Function block is this information.


  Fully Inlined S-Function with the mdlRTW Routine The Direct-Index Lookup Table Algorithm