Documentation

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 (MATLAB) or System Objects (MATLAB).

Methods

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
isOutputComplexImplComplexity of output ports
isOutputFixedSizeImplFixed- or variable-size output ports
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
supportsMultipleInstanceImplSupport System object in Simulink For Each subsystem

Classes

matlab.system.mixin.CustomIconCustom icon mixin class
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
matlab.system.mixin.PropagatesSignal characteristics propagation mixin class
matlab.system.mixin.NondirectNondirect feedthrough mixin class
matlab.system.mixin.SampleTimeControl sample time for System objects in Simulink

Topics

Overview

Define System Object for Use in Simulink

Develop MATLAB System block and interactively preview block dialog box.

System Design in Simulink Using System Objects

Steps for designing 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 Enumerations in System Objects

Define enumerated data for use in System objects

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 the System object class definition.

Related Information

System Objects (MATLAB)

Was this topic helpful?