Download MATLAB Compiler User`s Guide

Transcript
5
Controlling Code Generation
static void mdlInitializeConditions(real_T * x0,
SimStruct * S) {
}
/*
* The function mdlOutputs is a Compiler-generated
* Simulink S-function wrapper. Simulink calls this
* function to compute the S-function's output vector.
* This function initializes a table for use by the
* feval function and initializes any persistent
* variables. It then calls the function "mlxFun".
* Finally it clears the feval table and exits.
*/
static void mdlOutputs(real_T * y,
real_T const * x,
real_T const * u,
SimStruct * S,
int_T tid) {
mlfTry {
mlfFunctionTableSetup(1, function_table);
mclImportGlobal(0, NULL);
mclOutputs(y, x, u, S, tid, mlxFun);
mlfFunctionTableTakedown(1, function_table);
} mlfCatch {
mlfFunctionTableTakedown(1, function_table);
mclMexError();
} mlfEndCatch
}
/*
* The function mdlUpdate is a Compiler-generated
* Simulink S-function wrapper. Simulink calls this
* function to perform major time step updates.
* Simulink does not call this function if the
* S-function has no discrete states and has direct
* feedthrough. Since Compiler-generated S-functions
* meet these criteria, this function is never called,
* and is therefore left empty.
*/
5-40