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
Funktionen
sysobjupdate | Update custom System object to latest syntax (Seit R2020b) |
get | Get states and properties of a System object |
set | Set values for properties of a System object |
Klassen
matlab.System | Base class for System objects |
matlab.system.mixin.FiniteSource | Class that adds ability to check for the end of finite data source used by System object |
matlab.system.display.Action | Create custom button in Block Parameters dialog box for MATLAB System block |
matlab.system.display.Icon | Specify custom image as icon for MATLAB System block |
matlab.system.display.Header | Specify header in Block Parameters dialog box for MATLAB System block |
matlab.system.display.SectionGroup | Create nested groupings of properties in Block Parameters dialog box for MATLAB System block |
matlab.system.display.Section | Create property group section in Block Parameters dialog box for MATLAB System block |
Themen
Erste Schritte beim Schreiben von System objects
- Define Basic System Objects
Create a basic System object with the
stepImpl
method.
Eigenschaftsattribute
- Define Property Attributes
Specify property attributes to limit the type, visibility, and value of properties.
Eingabe und Ausgabe
- Change the Number of Inputs
This example shows how to set the number of inputs for a System object™ with and without usinggetNumInputsImpl
. - Define Composite System Objects
Define System objects that include other System objects as properties. - Handle Input Specification Changes
Implement methods to restrict when System object input complexity, data type, or size can change or implement a method to react when input specifications change.
Leistung und Effizienz
- Tips for Defining System Objects
Tips to speed up slow System objects. - Detailed Call Sequence
Call sequence showing the order of methods when you run a System object. - Define Finite Source Objects
This example shows how to define a System object that performs a specific number of steps or specific number of reads from a file. - Save and Load System Object
Use a MATLAB structure to save and load System object properties and state.
Verwandte Informationen
- Anpassen von System Objects für Simulink (Simulink)
- System Objects in MATLAB Code Generation (MATLAB Coder)