Main Content

Create System Objects

Write a MATLAB® class that creates and defines a new System object™

You can define your own System object by customizing the implementation methods. Use graphical tools to explore the comprehensive API for creating System objects. For example, you can insert methods to initialize, run, reset, and terminate System objects. For an introduction to defining a System object, see Define Basic System Objects.

Methods

expand all

Input Specification

getNumInputsImplNumber of inputs to the System object
isInputDataTypeMutableImplSet whether System object input data type can change
isInputSizeMutableImplSet whether System object input size can change
isInputComplexityMutableImplSet whether System object input complexity can change
isInputDirectFeedthroughImplDirect feedthrough status of input
getInputDimensionConstraintImplDefine input dimension constraints for dataflow subsystems

Output Specification

getNumOutputsImplNumber of outputs from System object
getOutputDataTypeImplData types of output ports
getOutputSizeImplSizes of output ports
isOutputComplexImplComplexity of output ports
isOutputFixedSizeImplFixed- or variable-size output ports
getOutputDimensionConstraintImplDefine output dimension constraints for dataflow subsystems

State Specification

getDiscreteStateSpecificationImplDiscrete state size, data type, and complexity
isDiscreteStateSpecificationMutableImplControl whether discrete states can change data type
getDiscreteStateImplDiscrete state property values

Sample Time Specification

getSampleTimeImplSpecify sample time type, offset time, and sample time
allowModelReferenceDiscreteSampleTimeInheritanceImplModel reference sample time inheritance status for discrete sample times

Interface Specification

getGlobalNamesImplGlobal variable names for MATLAB System block
getInterfaceImpl (Simulink)Set System object as message or data
isTunablePropertyDataTypeMutableImplSet whether tunable properties can change data type
isDoneImplEnd-of-data flag
getSimulateUsingImplSpecify value for Simulate using parameter
getSimulinkFunctionNamesImplRegister Simulink function names used in your System object
showFiSettingsImplFixed point data type tab visibility for System objects
supportsMultipleInstanceImplSupport System object in Simulink For Each subsystem
getImpulseResponseLengthImplDefine length of input effects for dataflow subsystems
supports1DVectorsImplEnable MATLAB System block to use 1-D signals for input and output

Block Dialog and Appearance

getPropertyGroupsImplProperty groups for System object display
showSimulateUsingImplVisibility of Simulate using parameter
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
isInactivePropertyImplStatus of inactive property

Simulation Methods

setupImplInitialize System object
stepImplSystem output and state update equations
resetImplReset System object states
releaseImplRelease resources
processTunedPropertiesImplAction when tunable properties change
validatePropertiesImplValidate property values of System object
processInputSpecificationChangeImplPerform actions when input size, complexity, or data type change
validateInputsImplValidate inputs to System object
updateImplUpdate object states based on inputs

Clone, Save, and Load

loadObjectImplLoad System object from MAT file
saveObjectImplSave System object in MAT file
cloneImpl Create duplicate System object

Help

infoImplInformation about System object

Functions for Implementing Authoring Methods

setPropertiesSet property values using name-value pairs when creating System object
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
createSampleTimeCreate sample time specification object
getSampleTimeQuery sample time
getCurrentTimeCurrent simulation time in MATLAB System block
setNumTicksUntilNextHit (Simulink)Set the number of ticks in Simulink sample time
displayScalarObjectDisplay format for scalar objects
getHeaderBuild customized display header text
getFooterBuild customized display footer text

Methods for Implementing System Objects

narginNumber of input arguments for System object
nargoutNumber of output arguments for System object
getNumInputsNumber of inputs required to call the System object
getNumOutputsNumber of outputs from calling the System object
setupOne-time set up tasks for System objects
resetReset internal states of System object
stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
cloneCreate duplicate System object
isDoneEnd-of-data status
isLockedDetermine if System object is in use
deleteDelete System object
outputQuery current output of a System object
updateUpdate state of a System object based on inputs
supportsMultipleInstanceCheck support for Simulink For Each subsystem for System object
getDiscreteStateGet the discrete states of a System object
getDiscreteStateSpecificationGet the size, data type, and complexity of the discrete state of a System object

Methods for Querying Output Specification of System Objects

getOutputSizeGet the size of outputs of a System object
isOutputFixedSizeCheck if outputs of a System object are fixed size
getOutputDataTypeGet data types of the outputs of a System object
isOutputComplexCheck if outputs of a System object are complex

Functions

sysobjupdateUpdate custom System object to latest syntax (Since R2020b)
getGet states and properties of a System object
setSet values for properties of a System object

Classes

matlab.SystemBase class for System objects
matlab.system.mixin.FiniteSourceClass that adds ability to check for the end of finite data source used by System object
matlab.system.display.ActionCreate custom button in Block Parameters dialog box for MATLAB System block
matlab.system.display.IconSpecify custom image as icon for MATLAB System block
matlab.system.display.HeaderSpecify header in Block Parameters dialog box for MATLAB System block
matlab.system.display.SectionGroupCreate nested groupings of properties in Block Parameters dialog box for MATLAB System block
matlab.system.display.SectionCreate property group section in Block Parameters dialog box for MATLAB System block

Topics

Input and Output

Performance and Efficiency

Featured Examples