Import and Export Parameter Constraints
You can use the Parameter Table to manage constraints on your model parameters for analysis. You can store groups of parameter constraints in a MATLAB® code file called a parameter configuration file. For more information on configuring parameters for Simulink® Design Verifier™, see Use Parameter Table to Find Constraints.
Export Parameter Constraints to File
Using the Parameter Table, you can export parameter constraint values to a MATLAB code file. If you later want to use the same parameter configuration in a different analysis, you can import your previously specified parameter constraint values from the MATLAB code file.
To export parameter constraint values to a file:
On the Design Verifier tab, in the Prepare section, from the drop-down menu for the mode settings, click Settings. In the Configuration Parameters dialog box, select Design Verifier > Parameters and Variants.
The Parameter Table shows specified constraint values for parameters in your model.
Click Export to File.
The Parameter Configuration File saves the current parameter configurations to a
.m
file with the name you specify. Parameters that do not have the Use check box enabled appear as commented lines in the parameter configuration file.In the example shown in the previous step, the parameter configuration file contains the following code:
function params = ex_many_params_config params.param_01 = {0, 1}; % params.param_02 = {0, 01}; params.param_03 = {0, 1}; % params.param_04 = {0, 1};
Import Parameter Constraints from File
If you defined parameter configurations for analysis in a release prior to R2014a, you can import corresponding MATLAB files and manage these parameters in the Parameter Table.
To import parameter constraints from a MATLAB code file:
On the Design Verifier tab, in the Prepare section, from the drop-down menu for the mode settings, click Settings. In the Configuration Parameters dialog box, select Design Verifier > Parameters and Variants.
Click Add from File. Choose a parameter configuration file.
The Parameter Table loads specified parameter constraints from the code, excluding code comments, from the file. If you specify a constraint for a parameter and then load a parameter configuration file containing constraint specification for the same parameter, the constraint specified in the file overwrites the preexisting constraint in the table.
Simulink
Design Verifier provides an example parameter configuration file for the model
sldvdemo_param_identification
in this example folder:
openExample('sldv/ParameterIdentificationExample',... 'supportingFile', 'sldvdemo_param_ident_config')
See Also
Use Parameter Table to Find Constraints | Set Parameters Using Parameter Configuration File