Main Content

Erstellen von System objects

Eine MATLAB®-Klasse schreiben, die ein neues System object™ erstellt und definiert

Sie können Ihr eigenes System object definieren, indem Sie die Implementierungsmethoden anpassen. Verwenden Sie grafische Tools, um die umfassende API zur Erstellung von System objects zu erkunden. Beispielsweise können Sie Methoden zum Initialisieren, Ausführen, Zurücksetzen und Beenden von System objects einfügen. Eine Einführung zum Definieren eines System objects finden Sie unter Define Basic System Objects.

Methoden

alle erweitern

Eingabespezifikation

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

Ausgebespezifikation

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

Statusspezifikation

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

Beispielzeitspezifikation

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

Schnittstellenspezifikation

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 und Darstellung

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

Simulationsmethoden

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

Klonen, Speichern und Laden

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

Hilfe

infoImplInformation about System object

Funktionen zur Implementierung von Schreibmethoden

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

Methoden zur Implementierung von 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

Methoden zur Abfrage der Ausgabespezifikation von 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

Funktionen

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

Klassen

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

Themen

Eingabe und Ausgabe

Leistung und Effizienz