This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Generate MATLAB Code for Operating Point Configuration

This topic shows how to generate MATLAB® code for operating point configuration using the Steady State Manager or Linear Analysis Tool. You can generate MATLAB code to programmatically reproduce a result that you obtained interactively.

You can also modify the script to compute multiple operating points with systematic variations in operating point specifications (batch computing). For more information, see Batch Compute Steady-State Operating Points Reusing Generated MATLAB Code.

Generate MATLAB Code from Steady State Manager

When computing operating points using the Steady State Manager, you can generate a MATLAB script or a live script for configuring operating point specifications and computing an operating point. To do so:

  1. To create a specification, in the Steady State Manager, on the Steady State tab, click Trim Specification.

  2. In the corresponding specification document, configure the operating point state, input, and output specifications. For an example, see Compute Operating Points from Specifications Using Steady State Manager.

  3. To specify optimization search settings, on the Specification tab, click Trim Options. For more information, see Change Operating Point Search Optimization Settings.

  4. To generate code that creates an operating point using your specifications and search options, click Trim , and select a code generation option.

    You can generate one of the following scripts:

    • Live script — Click Live Script. The generated live script opens in the MATLAB Live Editor.

    • MATLAB script — Click Script. The generated code opens in the MATLAB Editor.

Generate MATLAB Code from Linear Analysis Tool

When computing operating points using the Linear Analysis Tool, you can generate a MATLAB script for configuring operating point specifications and computing an operating point. To do so:

  1. In the Linear Analysis Tool, on the Linear Analysis tab, in the Operating Points drop-down list, click Trim Model.

  2. In the Trim the model dialog box, on the Specifications tab, configure the operating point state, input, and output specifications. For an example, see Compute Operating Points from Specifications Using Linear Analysis Tool.

  3. In the Options tab, specify search optimization settings. For more information, see Change Operating Point Search Optimization Settings.

  4. To generate code that creates an operating point using your specifications and search options, click Generate MATLAB Script.

    The generated code opens in the MATLAB Editor.

See Also

Functions

Apps

Related Topics