Design variable for optimization


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


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


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


Model parameter name, specified as a character vector or string for one parameter. For multiple parameters, specify as a cell array of character vectors or a string array. If a parameter is in a referenced model, the variable name must include the path.

For instance, if a parameter Ki is in a referenced model named Controller used in the top-level model, use p_des = sdo.getParameterFromModel('TopLevelModel','Controller:Ki').

If Ki is a model argument in a referenced model, provide block path from top-level model as follows, p_des = sdo.getParameterFromModel('TopLevelModel','TopLevelModel/ControlBlock:Ki'). Here, ControlBlock is the block name in the referenced model.

Output Arguments


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.


collapse all


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


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

Introduced in R2011b