Export Design Variable Values for Specific Iteration

This example shows how to export the design variable values for a specific optimization iteration.

During optimization, the optimization solver simulates the model using a different set of design variables at each iteration. After the optimization completes, you can export the values for an iteration from the iteration plot of the design variable set.

For this example, load a preconfigured Response Optimization tool session. Optimize the model, and export the design variable set values for the third iteration.

Open the Simulink model and load the preconfigured Response Optimization tool session.


The Response Optimization tool opens and loads the preconfigured session. Iteration Plot 1 is configured to plot the values of DesignVars for each optimization iteration.

Click Optimize.

The optimization completes after four iterations.

Select the iteration plot of the design variable set.

Click Iteration plot 1.

Open the Export Iteration Data dialog box.

Right-click on the iteration plot, and select Export.

Specify details regarding exporting the design variable set data:

  • In the Data to export list, select DesignVars.

  • In the Iteration(s) to export box, enter 3.

    To specify multiple iterations, use a vector of integers. For example, [0 2 5].

  • In the Export to a variable named box, enter DesignVars_iter.

Export the design variable values set to the Data area of the tool.

Click OK. The exported data variable, DesignVars_iter_3, appears in the Data.

    Note:   You will see the iteration number suffixed to the exported data variable name.

Related Examples

More About

Was this topic helpful?