Skip to content

Instantly share code, notes, and snippets.

@chitchcock
Created April 27, 2012 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chitchcock/2513236 to your computer and use it in GitHub Desktop.
Save chitchcock/2513236 to your computer and use it in GitHub Desktop.
mdlInitializeSampleTimes for S-Function blocks that can inherit sample time
#define MDL_INITIALIZE_SAMPLE_TIMES
static void mdlInitializeSampleTimes(SimStruct *S)
{
ssSetSampleTime(S, 0, INHERITED_SAMPLE_TIME);
ssSetOffsetTime(S, 0, 0.0);
ssSetModelReferenceSampleTimeInheritanceRule(S,
USE_DEFAULT_FOR_DISCRETE_INHERITANCE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment