Main Content

Creazione dei System object

Scrivere una classe di MATLAB® che crei e definisca un nuovo System object™

È possibile definire il proprio System object personalizzando i metodi di implementazione. Utilizzare gli strumenti grafici per esplorare l'API completa per la creazione dei System object. Ad esempio, è possibile inserire metodi per inizializzare, eseguire, resettare e terminare i System object. Per un’introduzione sulla definizione di System object, vedere Define Basic System Objects.

Metodi

espandi tutto

Specifiche di input

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

Specifiche di output

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

Specifiche di stato

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

Specifiche del tempo di campionamento

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

Specifiche dell’interfaccia

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

Blocco di dialogo e aspetto

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

Metodi di simulazione

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

Clonazione, salvataggio e caricamento

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

Guida

infoImplInformation about System object

Funzioni per l'implementazione dei metodi di scrittura

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

Metodi per l'implementazione dei System object

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

Metodi di interrogazione delle specifiche di output dei System object

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

Funzioni

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

Classi

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

Argomenti

Input e output

Prestazioni ed efficienza