param.Continuous

Create continuous parameter

Description

A continuous parameter is a numeric parameter that can take any value in a specified interval. The parameter can be scalar-valued or matrix-valued.

Typically, you use continuous parameters to create parametric models and to estimate or optimize tunable parameters in such models.

Creation

Create a continuous parameter object in one of the following ways.

Description

p = param.Continuous(name) creates a param.Continuous object and sets the Name property. The remaining properties of the object have default values.

example

p = param.Continuous(name,value) sets the Name and Value properties.

Properties

expand all

Flag to make the parameter tunable, specified as true (1) or false (0).

  • Specify true (1) to make the parameter tunable.

  • Specify false (0) to make the parameter nontunable.

The dimension of this property must match the dimension of the Value property.

For matrix-valued parameters, you can:

  • Fix individual matrix elements. For example, p.Free = [true false; false true] or p.Free([2 3]) = false.

  • Use scalar expansion to fix all matrix elements. For example, p.Free = false.

Parameter units and labels, specified as a structure array with fields Label and Unit.

The array dimension must match the dimension of the Value property.

Use this property to store parameter units and labels that describe the parameter. For example, p.Info(1,1).Unit = 'N/m'; or p.Info(1,1).Label = 'spring constant'.

The default value for both the Label and Unit fields is ''.

Upper bound for the parameter value, specified as a scalar or matrix.

The dimension of this property must match the dimension of the Value property.

For matrix-valued parameters, you can:

  • Specify upper bounds on individual matrix elements. For example, p.Maximum([1 4]) = 5.

  • Use scalar expansion to set the upper bound for all matrix elements. For example, p.Maximum = 5.

Lower bound for the parameter value, specified as a scalar or matrix.

The dimension of this property must match the dimension of the Value property.

For matrix-valued parameters, you can:

  • Specify lower bounds on individual matrix elements, for example, p.Minimum([1 4]) = -5.

  • Use scalar expansion to set the lower bound for all matrix elements. For example, p.Minimum = -5.

This property is read-only.

Set this property at object creation.

Scaling factor for normalizing the parameter value, specified as a scalar or matrix.

The dimension of this property must match the dimension of the Value property.

For matrix-valued parameters, you can:

  • Specify scaling for individual matrix elements. For example, p.Scale([1 4]) = 1.

  • Use scalar expansion to set the scaling for all matrix elements. For example, p.Scale = 1.

Parameter value, specified as a scalar or matrix.

Set the dimension of this property at object creation.

Object Functions

isrealDetermine if parameter value, minimum, and maximum are real

Examples

collapse all

Construct a param.Continuous object and specify the maximum value.

p = param.Continuous('K',eye(2));
p.Maximum = 5;
Introduced in R2012b