User`s guide

4
Guidelines for Writing
C MEX S-Functions
Introduction ....................4-2
Classes of Problems Solved by S-Functions . . . . . . . . 4-2
TypesofS-Functions.................4-3
Basic Files Required for Implementation . . . . . . . . . 4-5
Noninlined S-Functions ...............4-7
Writing Wrapper S-Functions ............4-8
TheMEXS-FunctionWrapper.............4-8
TheTLCS-FunctionWrapper .............4-13
TheInlinedCode...................4-17
Fully Inlin ed S-Functions ..............4-18
MultiportS-FunctionExample.............4-18
Fully Inlined S-Function with the mdlRTW Routine . . 4-20
The Direct-Index Lookup Table Algorithm . . . . . . . . 4-21
The Direct-Index Lookup Table Example . . . . . . . . . 4-22