Simulink 函数
定义可从整个 Simulink 模型层次结构访问的函数
您可以使用 Simulink® 函数来定义可在 Simulink 模型层次结构中访问的函数。Simulink 函数根据提供的输入和实现的函数行为计算一组输出。您可以使用 Simulink 函数来:
指定包含函数名称、输入和输出参量的函数原型,例如
y = f(u)
。使用 Simulink Function 模块、从 Stateflow® 图导出的函数或 S-Function 模块在 Simulink 环境中实现函数行为。
跨模型层次结构调用和重用您的函数。
有关详细信息,请参阅Simulink Functions Overview。
模块
主题
了解 Simulink 函数
- Simulink Functions Overview
Use Simulink functions to define functions that are accessible in the Simulink model hierarchy. - 在模型中定义 Simulink 函数
使用 Simulink Function 模块、导出的 Stateflow 函数或 S-Function 模块定义一个 Simulink 函数。 - 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.
限定作用域的 Simulink 函数
- 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.
作用域限于端口的 Simulink 函数
- 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.
相关信息
- 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)