Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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 or string. For example, 'sldo_model1'.

paramname

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. 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');

Introduced in R2011b

Was this topic helpful?