I would like to create an S-Function that has the ability to switch between being continuous and discrete. I set the ssSetNumContStates and ssSetNumDiscStates macros to DYNAMICALLY_SIZED and specify the real number of states in the mdlSetWorkWidths method. This does not work when the S-Function inherits a discrete sample time and I receive the following error message:
S-function edge in 'test_edge/S-Function' must have a continuous sample time since it has continuous states.
Best Answer