Main Content

Use C API to Monitor and Tune Generated Model Code

To monitor and tune you model by using the C API:

  1. Configure your model to include in the generated code C API elements that correspond to model elements you want to measure or tune.

  2. Write code to interface with the generated C API code while the generated model code is running on the target platform.

  3. During execution of the generated model code on the target platform, use the C API code to monitor and tune model elements.

  4. Determine the suitable values of model elements you need to tune.

  5. Update your model elements with the new values you obtained in the calibration process.

  6. Repeat these steps until the parameters are sufficiently tuned for your requirements.

You can use the C API to measure these model elements:

  • model signals

  • model states

  • root-level input ports

  • root-level output ports

You can use the C API to tune these model elements:

  • model parameters

  • block parameters

You can use C API with any combination of supported model elements.

Use C API to Measure Model Signals and Tune Model Parameters

This example shows how to use the C API to measure model signals and tune model parameters while the generated model code is running on the target platform. The example guides you through these steps:

Related Topics