| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
No
#define MDL_RTW
void mdlRTW(SimStruct *S)
WriteRTW(s)
Instance of Simulink.MSFcnRunTimeBlock class representing the Level-2 M-File S-Function block.
This function is called when the Real-Time Workshop product is generating the model.rtw file. In C MEX S-functions, you can call the following functions that add fields to the model.rtw file:
In C MEX S-functions, this function must be enclosed in a #if defined(MATLAB_MEX_FILE) statement.
In Level-2 M-file S-functions, use the run-time object's WriteRTWParam method to write custom parameters to the model.rtw file.
C, C++, M
See the S-function matlabroot/toolbox/simulink/simdemos/simfeatures/src/sfun_multiport.c in the Simulink model sldemo_msfcn_lms.mdl for an example.
See the S-function matlabroot/toolbox/simulink/simdemos/simfeatures/adapt_lms.m in the Simulink model sfcndemo_sfun_multiport.mdl for an example.
ssSetInputPortFrameData, ssSetOutputPortFrameData, ssSetErrorStatus
![]() | mdlProjection | mdlSetDefaultPortComplexSignals | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |