Main Content

setTunable

Set specified parameter settings as tunable or nontunable

Description

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

example

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

To obtain these parameter settings, use getTunableSettings.

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

Output Arguments

collapse all

Modified tunable 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 paramsIn, except with all tunable parameters set to the value specified in tunableFlag.

Version History

Introduced in R2019a