Main Content

Customize System Objects for Simulink

Customize System object™ for use in MATLAB System block

The MATLAB System block enables a System object defined in MATLAB® to be used as a block in Simulink®. To control the block appearance or output, or to enable System object usage in a For Each subsystem, use the provided implementation methods to customize your System object. For more information about defining a System object, see Define Basic System Objects or System Objects.


expand all

getIconImplName to display as block icon
getHeaderImplHeader for System object display
getInputNamesImplNames of MATLAB System block input ports
getOutputNamesImplNames of MATLAB System block output ports
getPropertyGroupsImplProperty groups for System object display
getSimulateUsingImplSpecify value for Simulate using parameter
showSimulateUsingImplVisibility of Simulate using parameter
showFiSettingsImplFixed point data type tab visibility for System objects
allowModelReferenceDiscreteSampleTimeInheritanceImplModel reference sample time inheritance status for discrete sample times
getGlobalNamesImplGlobal variable names for MATLAB System block
getDiscreteStateImplDiscrete state property values
getDiscreteStateSpecificationImplDiscrete state size, data type, and complexity
getOutputDataTypeImplData types of output ports
getOutputSizeImplSizes of output ports
getSimulinkFunctionNamesImplRegister Simulink function names used in your System object
getInterfaceImplSet System object as message or data
isOutputComplexImplComplexity of output ports
isOutputFixedSizeImplFixed- or variable-size output ports
processTunedPropertiesImplAction when tunable properties change
propagatedInputComplexityComplexity of input during Simulink propagation
propagatedInputDataTypeData type of input during Simulink propagation
propagatedInputFixedSizeFixed-size status of input during Simulink propagation
propagatedInputSizeSize of input during Simulink propagation
isInputDirectFeedthroughImplDirect feedthrough status of input
outputImplOutput calculation from input or internal state of System object
updateImplUpdate object states based on inputs
createSampleTimeCreate sample time specification object
getSampleTimeImplSpecify sample time type, offset time, and sample time
getSampleTimeQuery sample time
getCurrentTimeCurrent simulation time in MATLAB System block
setNumTicksUntilNextHitSet the number of ticks in Simulink sample time
supportsMultipleInstanceImplSupport System object in Simulink For Each subsystem


expand all

matlab.system.display.IconCustom icon image
matlab.system.display.ActionCustom button
matlab.system.display.HeaderHeader for System objects properties
matlab.system.display.SectionProperty group section for System objects
matlab.system.display.SectionGroupSection group for System objects



Define System Object for Use in Simulink

Develop MATLAB System block and interactively preview block dialog box.

System Design in Simulink Using System Objects

Design systems in Simulink using System objects.

Block Appearance

Customize System Block Appearance

Customize the MATLAB System block icon and the input and output names.

Customize System Block Dialog Box

Customize the MATLAB System block dialog box by adding tabs, groups, description, and more.

Input and Output

Set Model Reference Discrete Sample Time Inheritance

Disallow model reference discrete sample time inheritance for a System object.

Use Global Variables in System Objects

Define global variables for use in System objects.

Specify Output

If Simulink cannot infer the System object output characteristics, add methods to specify the size, data type, complexity, or discrete state output.

Special Use Cases

Use Update and Output for Nondirect Feedthrough

Implement nondirect feedthrough for a System object using the updateImpl, outputImpl, and isInputDirectFeedthroughImpl methods.

Enable For Each Subsystem Support

Enable For Each subsystem support by using a System object in a Simulink For Each subsystem.

Specify Sample Time for MATLAB System Block System Objects

This example shows how to control the sample time of the MATLAB System block using System object™ methods.

Related Information

Featured Examples