User`s guide
iii
Function-Call Subsystems ............................ 3-95
The C MEX S-Function SimStruct ..................... 3-97
Converting Level 1 C MEX S-Functions to Level 2 ...... 3-118
4
Guidelines for Writ ing C MEX S-Functions
Introduction .......................................... 4-2
ClassesofProblemsSolvedbyS-Functions ................ 4-2
TypesofS-Functions .................................. 4-3
BasicFilesRequiredforImplementation.................. 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 Inlined S-Functions ............................. 4-18
MultiportS-FunctionExample ......................... 4-18
Fully Inlined S-Function with the mdlRTW Routine ..... 4-20
TheDirect-IndexLookupTableAlgorithm................ 4-21
TheDirect-IndexLookupTableExample................. 4-22