Simulink-Funktionen
Sie können Simulink®-Funktionen verwenden, um Funktionen zu definieren, die von der Simulink-Modellhierarchie aus zugänglich sind. Eine Simulink-Funktion berechnet einen Satz Ausgaben auf Grundlage der bereitgestellten Eingaben und dem implementierten Verhalten der Funktion. Mit Simulink-Funktionen können Sie:
Den Funktionsprototypen festlegen, der den Funktionsnamen sowie Eingabe- und Ausgabeargumente enthält, beispielsweise
y = f(u)
.Funktionsverhalten in der Simulink-Umgebung mit einem Simulink Function-Block, einer aus einem Stateflow®-Diagramm exportierten Funktion oder einem S-Function-Block implementieren.
Ihre Funktion über die Modellhierarchie hinweg aufrufen und wiederverwenden.
Weitere Informationen finden Sie unter Simulink Functions Overview.
Blöcke
Themen
Simulink-Funktionen verstehen
- Simulink Functions Overview
Use Simulink functions to define functions that are accessible in the Simulink model hierarchy. - Define a Simulink Function in a Model
Define a Simulink function using a Simulink Function block, an exported Stateflow function, or an S-Function block. - Call a Simulink Function from a Model
Call a Simulink function using a Function Caller block, a Stateflow chart, a MATLAB Function or MATLAB System block, an S-Function block, or an event action of a SimEvents® block. - 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. - Resolve Error: Block Is Unable to Call The Scoped Simulink Function
Troubleshoot block unable to call the function error in Simulink.
Port-Scoped-Simulink-Funktionen
- Model Client and Server Components Using Function Ports
Use function ports to model client and server components in a service-oriented architecture. - Service Interfaces Overview (System Composer)
Create client and server ports, author service interfaces, and simulate service-oriented communication.
Verwandte Informationen
- Model Service-Oriented Communication Between Sensors (System Composer)
- Simulate Asynchronous Services for Vehicle Headlight Management (System Composer)
- Trigger Simulink Components with Discrete Events in SimEvents (SimEvents)
- Configure AUTOSAR Client-Server Communication (AUTOSAR Blockset)
- Model AUTOSAR Adaptive Service Communication (AUTOSAR Blockset)
- Generate Reentrant Code from Simulink Function Blocks (Embedded Coder)