param.Continuous class

Package: param

Continuous parameter

Syntax

p = param.Continuous(paramname)
p = param.Continuous(paramname,paramvalue)

Description

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

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

Construction

p = param.Continuous(paramname) constructs a param.Continuous object and assigns the specified parameter name to the Name property and default values to the remaining properties.

p = param.Continuous(paramname,paramvalue) assigns the specified parameter value to the Value property.

sdo.getParameterFromModel also constructs a param.Continuous object or an array of param.Continuous objects for Simulink® model parameters.

Input Arguments

paramname

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

paramvalue

Scalar or matrix numeric double

Properties

Free

Flag specifying whether the parameter is tunable or not.

Set the Free property to true (1) for tunable parameters and false (0) for parameters you do not want to tune (fixed).

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.

Default: true (1)

Info

Structure array specifying parameter units and labels.

The structure has Label and Unit fields.

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

Default: '' for both Label and Unit fields

Maximum

Upper bound for the parameter value.

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.

Default: Inf

Minimum

Lower bound for the parameter value.

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.

Default: –Inf

Name

Parameter name.

This property is read-only and is set at object construction.

Default: ''

Scale

Scaling factor used to normalize the parameter value.

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.

Default: 1

Value

Scalar or matrix value of a parameter.

The dimension of this property is set at object construction.

Default: 0

Methods

isrealDetermine if parameter value, minimum and maximum are real

Copy Semantics

Value. To learn how value classes affect copy operations, see Copying Objects (MATLAB).

Examples

collapse all

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

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