Main Content

Sample Time

Control block execution rates; assign discrete, continuous, or hybrid sample time

The sample time of a block is a parameter that indicates when, during simulation, the block produces outputs and if appropriate, updates its internal state. The internal state includes but is not limited to continuous and discrete states that are logged. In engineering, sample time refers to the rate at which a discrete system samples its inputs. Simulink® allows you to model single-rate and multirate discrete systems and hybrid continuous-discrete systems through the appropriate setting of block sample times that control the rate of block execution (calculations).

Customize Sample Time Colors

simulink.sampletimecolors.PaletteCreate custom sample time color palette for Simulink model

simulink.sampletimecolors.storePaletteAdd new simulink.sampletimecolors.Palette object to preferences

simulink.sampletimecolors.getPaletteGet available simulink.sampletimecolors.Palette objects

simulink.sampletimecolors.applyPaletteApply sample time color palette to current MATLAB session

simulink.sampletimecolors.removePaletteRemove simulink.sampletimecolors.Palette object from preferences

Functions

Simulink.BlockDiagram.getSampleTimesReturn all sample times associated with model
Simulink.Block.getSampleTimesReturn sample time information for a block

Classes

Simulink.SampleTimeObject containing sample time information
Simulink.BlockPortDataDescribe block input or output port

Topics