param.Discrete
Description
A discrete parameter is a parameter that can take one of a specified, finite set of values. The allowed values can be a set of numeric values or a set of strings. The parameter itself can be scalar-valued or array-valued. For an array-valued parameter, each free entry in the array can take any of the allowed values, independently.
Typically, you use discrete parameters to estimate or optimize tunable parameters in
parametric models. For instance, when performing response optimization or parameter estimation
with sdo.optimize
, use sdo.getParameterFromModel
to
create param.Discrete
objects corresponding to parameters in your Simulink® model.
Note
To use discrete-valued parameters for response optimization or parameter estimation, you
must use the surrogateopt
optimization method, specified with sdo.OptimizeOptions
.
Creation
Create a discrete parameter object in one of the following ways.
sdo.getParameterFromModel
to create objects corresponding to discrete-valued parameters in a Simulink model.param.Discrete
function.
Description
creates a scalar parameter and sets the p
= param.Discrete(name
)Name
property. The remaining
properties of the object have default values.
creates a parameter with the same dimensions as p
= param.Discrete(name
,value
)value
and sets the
Value
property.
specifies the set of discrete values that the parameter can take.
p
= param.Discrete(name
,value
,valueset
)value
must be present in valueset
.
Properties
Examples
Version History
Introduced in R2022b