Main Content

setTunable

Set specified parameter settings as tunable or nontunable

Since R2019a

Description

example

paramsOut = setTunable(paramsIn,tunableFlag) sets the paramsIn parameters as tunable or nontunable using tunableFlag. The modified tunable parameter settings are returned in paramsOut.

Examples

collapse all

Create a fuzzy inference system, and define the tunable parameter settings of inputs, outputs, and rules.

Create a FIS, and obtain its tunable settings.

fis = mamfis("NumInputs",2,"NumOutputs",2);
[in,out,rule] = getTunableSettings(fis);

You can specify all the input variables, output variables, or rules as tunable or nontunable. For example, set all the output variable settings as nontunable.

out = setTunable(out,0);

You can set the tunability of individual variables or rules. For example, set the first input variable as nontunable.

in(1) = setTunable(in(1),0);

You can set individual membership functions as nontunable. For example, set the first membership function of input 2 as nontunable.

in(2).MembershipFunctions(1) = setTunable(in(2).MembershipFunctions(1),0);

You can also specify the tunability of a subset of variables or rules. For example, set the first two rules as nontunable.

rule(1:2) = setTunable(rule(1:2),0);

Input Arguments

collapse all

Tunable parameter settings, specified as one of the following:

  • VariableSettings object or an array of such objects

  • RuleSettingsObject object or an array of such objects

  • MembershipFunctionSettings object or an array of such objects

  • MembershipFunctionSettingsType2 object or an array of such objects

array of input, output, and rule parameter settings of a fuzzy system. To obtain these parameter settings, use getTunableSettings with the input FIS. paramsetIn can be the input parameter, the output parameter, the rule parameter, or some combination of these parameters as an array. The contents of the array depend on which parameters you would like to set.

Parameter tunability for the parameters specified in paramsIn, specified as a logical 1 (tunable) or 0 (nontunable).

Output Arguments

collapse all

Modified unable parameter settings, returned as one of the following:

  • VariableSettings object or an array of such objects

  • RuleSettingsObject object or an array of such objects

  • MembershipFunctionSettings object or an array of such objects

  • MembershipFunctionSettingsType2 object or an array of such objects

paramsOut is the same as paramsetIn, except with all tunable parameters set to the value specified in tunableFlag.

Version History

Introduced in R2019a