Main Content

Crear System objects

Escriba una clase de MATLAB® que cree y defina un nuevo System object™

Para poder definir un System object propio, se deben personalizar los métodos de implementación. Use herramientas gráficas para explorar la extensa API y crear System objects. Por ejemplo, se pueden insertar métodos para inicializar, ejecutar, restablecer y terminar System objects. Para ver una introducción a la definición de un System object, consulte Define Basic System Objects.

Métodos

expandir todo

Especificación de entrada

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

Especificación de salida

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

Especificación de estado

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

Especificación del tiempo de muestreo

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

Especificación de la interfaz

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

Diálogo de bloque y aspecto

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

Métodos de simulación

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

Clonar, guardar y cargar

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

Ayuda

infoImplInformation about System object

Funciones para implementar métodos de creación

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

Métodos para implementar 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
stepEjecutar el algoritmo System object
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

Métodos para consultar la especificación de salida de los 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

Funciones

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

Clases

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

Temas

Entrada y salida

Rendimiento y eficiencia

Información relacionada