Documentation

Customize System Objects for Simulink

Customize System object™ for use inMATLAB Systemblock

TheMATLAB Systemblock 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, seeDefine Basic System Objects(MATLAB) orSystem Objects(MATLAB).

Methods

expand all

getIconImpl Name to display as block icon
getHeaderImpl Header for System object display
getInputNamesImpl Names of MATLAB System block input ports
getOutputNamesImpl Names of MATLAB System block output ports
getPropertyGroupsImpl Property groups for System object display
getSimulateUsingImpl Specify value for Simulate using parameter
showSimulateUsingImpl Visibility of Simulate using parameter
showFiSettingsImpl Fixed point data type tab visibility for System objects
allowModelReferenceDiscreteSampleTimeInheritanceImpl Model reference sample time inheritance status for discrete sample times
getGlobalNamesImpl Global variable names for MATLAB System block
getDiscreteStateImpl Discrete state property values
getDiscreteStateSpecificationImpl Discrete state size, data type, and complexity
getOutputDataTypeImpl Data types of output ports
getOutputSizeImpl Sizes of output ports
isOutputComplexImpl Complexity of output ports
isOutputFixedSizeImpl Fixed- or variable-size output ports
processTunedPropertiesImpl Action when tunable properties change
propagatedInputComplexity Complexity of input during Simulink propagation
propagatedInputDataType Data type of input during Simulink propagation
propagatedInputFixedSize Fixed-size status of input during Simulink propagation
propagatedInputSize Size of input during Simulink propagation
isInputDirectFeedthroughImpl Direct feedthrough status of input
outputImpl Output calculation from input or internal state of System object
updateImpl Update object states based on inputs
createSampleTime Create sample time specification object
getSampleTimeImpl Specify sample time type, offset time, and sample time
getSampleTime 查询样品时间
getCurrentTime Current simulation time in MATLAB System block
setNumTicksUntilNextHit Set the number of ticks in Simulink sample time
supportsMultipleInstanceImpl Support System object in Simulink For Each subsystem

Classes

expand all

matlab.system.mixin.CustomIcon Custom icon mixin class
matlab.system.display.Icon Custom icon image
matlab.system.display.Action Custom button
matlab.system.display.Header Header for System objects properties
matlab.system.display.Section Property group section for System objects
matlab.system.display.SectionGroup Section group for System objects
matlab.system.mixin.Propagates Signal characteristics propagation mixin class
matlab.system.mixin.Nondirect Nondirect feedthrough mixin class
matlab.system.mixin.SampleTime Control sample time for System objects in Simulink

Topics

Overview

Define System Object for Use in Simulink

DevelopMATLAB Systemblock 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 theMATLAB Systemblock icon and the input and output names.

Customize System Block Dialog Box

Customize theMATLAB Systemblock 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

使用全局变量在系统对象

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 theupdateImpl,outputImpl, andisInputDirectFeedthroughImplmethods.

Enable For Each Subsystem Support

EnableFor Eachsubsystem support by using a System object in a SimulinkFor Eachsubsystem.

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

System Objects(MATLAB)

Was this topic helpful?