| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
time_T ssSetSampleTime(SimStruct *S, int_T st_index, time_T period)
SimStruct representing an S-Function block.
Index of the sample time whose period is to be set.
Period of the sample time specified by st_index.
The time_T sample time value specified by period.
Use this macro in mdlInitializeSizes or mdlInitializeSampleTimes to specify the period of the sample time where st_index starts at 0. See Setting Sample Times and Offsets for more information. Use ssSetOffsetTime if the sample time has an associated offset.
C, C++
See the following S-functions for examples that use this function:
matlabroot/toolbox/simulink/simdemos/simfeatures/src/mixedmex.c used in sfcndemo_mixedmex.mdl
matlabroot/toolbox/simulink/simdemos/simfeatures/src/sfun_dtype_io.c used in sfcndemo_dtype_io.mdl
matlabroot/toolbox/simulink/simdemos/simfeatures/src/stvdtf.c used in sfcndemo_stvdtf.mdl
ssSetInputPortSampleTime, ssSetOutputPortSampleTime, ssSetOffsetTime
![]() | ssSetRunTimeParamInfo | ssSetSFcnParamNotTunable | ![]() |

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 |