生成代码接口
使用 C API 接口和代码描述符接口在生成的代码和外部应用程序代码之间交换数据
一些应用程序必须在生成的代码和外部应用程序代码之间交换数据。使用 MATLAB 代码描述符 API 获取有关生成代码的元数据。使用 C API 在运行时与生成的代码对接,并在目标平台上执行模型代码期间监控并调节模型元素。
类
函数
主题
C API 接口
- Get Started with C API
Learn the principles of using C API to interact with the generated model code.
- Configure Model to Generate C API Code
Learn how to configure your model to include different types of C API elements in the generated code.
- Write External Code to Access Generated C API Code
Learn how to write external code that can access generated C API code elements.
- Use C API to Monitor and Tune Generated Model Code
Learn the details about how to use the C API to monitor and tune model elements.
- 步骤 1: Explore Measurable and Tunable Model Elements
- 步骤 2: Configure Model to Add C API Signals in Code Generation
- 步骤 3: Write Code to Interact with Generated C API Signal Code
- 步骤 4: Interact with C API Signal Code Throughout Execution
- 步骤 5: Write Code to Interact with Generated C API Signal and Parameter Code
- 步骤 6: Use Custom Monitor to Measure and Tune Model Elements in Real Time
代码描述符接口
- Get Code Description of Generated Code
Obtain metadata about the generated code. - Get Generated Type and Name of Inport Structures
Obtain metadata about the inport structures in generated code. - Get Metadata About Test Points and Logged Signals in Generated Code
Retrieve metadata for test points and logged signals in generated code.