Documentation

sdo.getParameterFromModel

Design variable for optimization

Syntax

p_des = sdo.getParameterFromModel(modelname,paramname)
p_des = sdo.getParameterFromModel(modelname)

Description

p_des = sdo.getParameterFromModel(modelname,paramname) creates an object from a Simulink® model parameter that you can tune to satisfy design requirements during optimization. The model must be open.

p_des = sdo.getParameterFromModel(modelname) creates model parameter objects for all the parameters in the model.

Input Arguments

modelname

Simulink model name, specified as a character vector. For example, sldo_model1.

paramname

Model parameter name, specified as a character vector for one parameter or a cell array of character vectors for multiple parameters. For example, {'Kp','Ki'}.

Output Arguments

p_des

A param.Continuous object for one parameter or an array of objects for multiple parameters.

If paramname is not specified, then p_des contains all the parameters of the model.

The Value property of the object is set to the current value of the model parameter.

Examples

collapse all

load_system('sldo_model1_stepblk');

p_des = sdo.getParameterFromModel('sldo_model1_stepblk','Kp');
paramname = {'Kp','Ki','Kd'};

load_system('sldo_model1_stepblk');

p_des = sdo.getParameterFromModel('sldo_model1_stepblk',paramname);
load_system('sldo_model1_stepblk');
p_des = sdo.getParameterFromModel('sldo_model1_stepblk');

Related Examples

Introduced in R2011b

Was this topic helpful?