Main Content

matlab.system.mixin.SampleTime class

Control sample time for System objects in Simulink

The matlab.system.mixin.SampleTime mixin will be removed in a future release. You no longer need to inherit from this mixin in your System object. The associated sample time methods have been moved to the matlab.System class.

Description

matlab.system.mixin.SampleTime specifies the sample time specifications for a System object™ when it is included in a MATLAB System block. Inherit from this mixin class and use its methods to control the sample time of your System object in Simulink®, via the MATLAB System block.

With this mixin, you can:

  • Specify the sample time type

  • Specify the sample time

  • Customize the sample time with offsets and tick times

  • Get the current simulation time

System objects that inherit from this mixin class must also inherit from matlab.System. For example:

classdef MySystemObject < matlab.System & matlab.system.mixin.SampleTime

The matlab.system.mixin.SampleTime class is a handle class.

Methods

Compatibility Considerations

expand all

Not recommended starting in R2020a

Introduced in R2017b