Simulink-Funktionen
Eine Simulink®-Funktion ist eine Recheneinheit, die einen Satz von Ausgaben berechnet, wenn sie einen Satz von Eingaben erhält. Da eine Simulink-Funktion eine gemeinsame Textschnittstelle zu ihrer Funktionsdefinition und einem Funktionsaufrufer bietet, liegt es bei Ihnen, wie Sie die Funktion definieren. Mögliche Funktionsdefinitionen sind zum Beispiel:
Simulink-Blöcke in einem Simulink Function-Block
Stateflow®-Zustandsübergänge in einer aus Stateflow exportierten grafischen Funktion
MATLAB®-Code-Anweisungen in einer aus Stateflow exportierten MATLAB-Funktion
Nachdem Sie eine Funktion definiert haben, können Sie sie mithilfe eines Function Caller-Blocks, eines MATLAB Function-Blocks oder eines Stateflow-Diagramms aufrufen.
Blöcke
Themen
Simulink-Funktionen verstehen
- Simulink Functions Overview
Functions in a Simulink model that share a common text interface with function callers. - Add a Simulink Function to a Model
Define a Simulink function using a Simulink Function block or an exported graphical or MATLAB function from a Stateflow chart. - Call a Simulink Function from a Model
Call a Simulink function from a Simulink model using a Function Caller block, a MATLAB Function block, or a Stateflow chart. - Scoped, Global, and Port-Scoped Simulink Function Blocks Overview
Specify visibility and access of Simulink Function blocks. - Simulink Function Blocks in Referenced Models
Add and access functions in model components.
Scoped Simulink-Funktionen
- Scoped Simulink Function Blocks in Subsystems
Limit the scope of a function to a subsystem. - Scoped Simulink Function Blocks in Models
Limit the scope of a function to a model. - Define Diagnostic Services Using Simulink Functions
Create a diagnostic service with functions where callers pass an error code. - Resolve Error: Block Is Unable to Call The Scoped Simulink Function
Troubleshoot block unable to call the function error in Simulink.
Client-Server-Schnittstellen in Simulink
- Model Client-Server Communication Using Function Ports
Use function ports to model client and server components in a service-oriented architecture. - Model Service-Oriented Communication Between Sensors (System Composer)
Use a service interface to call services from multiple instances of a referenced component. - Service Interfaces Overview (System Composer)
Create client and server ports, author service interfaces in Interface Editor, associate interfaces with ports.