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 Design 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 Design Optimization tool session.
The Design Optimization tool opens and loads the preconfigured session. Iteration Plot 1 is configured to plot the values of DesignVars for each optimization iteration.
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 Design Optimization Workspace.
Click OK. The exported data variable, DesignVars_iter_3, appears in the Design Optimization Workspace.