getTunableSettings

Obtain tunable settings from fuzzy inference system

Description

in = getTunableSettings(fis) returns tunable settings of input variables of the fuzzy system fis.

[~,out] = getTunableSettings(fis) returns tunable settings of output variables of the fuzzy system fis.

[~,~,rule] = getTunableSettings(fis) returns tunable settings of rules of the fuzzy system fis.

example

[in,out,rule] = getTunableSettings(fis) returns tunable settings of inputs, outputs, and rules of the fuzzy system fis.

example

[___] = getTunableSettings(fis,'AsymmetricLag',true) returns tunable settings which allow asymmetric lower membership function lag values. This syntax is supported only when fis is a type-2 fuzzy inference system.

Examples

collapse all

Create two fuzzy inference systems, and define the connection between the two.

fis1 = mamfis('Name','fis1','NumInputs',2,'NumOutputs',1);
fis2 = sugfis('Name','fis2','NumInputs',2,'NumOutputs',1);
con = ["fis1/output1" "fis2/input1"];

Create a tree of fuzzy inference systems.

tree = fistree([fis1 fis2],con);

Obtain the tunable settings of inputs, outputs, and rules of the fuzzy inference system.

[in,out,rule] = getTunableSettings(tree)
in=4×1 object
  4x1 VariableSettings array with properties:

    Type
    VariableName
    MembershipFunctions
    FISName

out=2×1 object
  2x1 VariableSettings array with properties:

    Type
    VariableName
    MembershipFunctions
    FISName

rule=18×1 object
  16x1 RuleSettings array with properties:

    Index
    Antecedent
    Consequent
    FISName
      ⋮

You can use dot notation to specify tunable settings.

For the first membership function of input 1:

  • do not tune parameter 1,

  • set the minimum ranges of the last two parameters to 0,

  • and set the maximum ranges of the last two parameters to 1.

in(1).MembershipFunctions(1).Parameters.Free(1) = false;
in(1).MembershipFunctions(1).Parameters.Minimum(2:end) = 0;
in(1).MembershipFunctions(1).Parameters.Maximum(2:end) = 1;

For the first rule:

  • set input 1 membership function index non-tunable,

  • allow NOT logic for input 2 membership function index,

  • and do not ignore output 1 membership function index.

rule(1).Antecedent.Free(1) = false;
rule(1).Antecedent.AllowNot(2) = true;
rule(1).Consequent.AllowEmpty(1) = false;

Create two fuzzy inference systems, and define the connection between the two.

fis1 = mamfis('Name','fis1','NumInputs',2,'NumOutputs',1);
fis2 = sugfis('Name','fis2','NumInputs',2,'NumOutputs',1);
con = ["fis1/output1" "fis2/input1"];

Create a tree of fuzzy inference systems.

tree = fistree([fis1 fis2],con);

Obtain the tunable settings of input and output variables of the fuzzy inference system.

[in,out] = getTunableSettings(tree)
in=4×1 object
  4x1 VariableSettings array with properties:

    Type
    VariableName
    MembershipFunctions
    FISName

out=2×1 object
  2x1 VariableSettings array with properties:

    Type
    VariableName
    MembershipFunctions
    FISName

You can use dot notation to specify the tunable settings of input and output variables.

For the first membership function of input 1, set the first and third parameters to tunable.

in(1).MembershipFunctions(1).Parameters.Free = [1 0 1];

For the first membership function of input 2, set the minimum parameter range to 0.

in(2).MembershipFunctions(1).Parameters.Minimum = 0;

For the first membership function of output 2, set the maximum parameter range to 1.

out(2).MembershipFunctions(1).Parameters.Maximum = 1;

Create a type-2 fuzzy inference system.

fis = mamfistype2('Name','fis1','NumInputs',2,'NumOutputs',1);

Obtain the tunable settings of the input and output variables of the fuzzy inference system.

[in,out] = getTunableSettings(fis);

You can use dot notation to specify the tunable settings of the membership functions of the input and output variables.

For the first membership function of input 1, set the first and third upper membership function parameters as tunable.

in(1).MembershipFunctions(1).UpperParameters.Free = [1 0 1];

For the first membership function of input 2, set the tunable range of the lower membership function scale to be between 0.7 and 0.9.

in(2).MembershipFunctions(1).LowerScale.Minimum = 0.7;
in(2).MembershipFunctions(1).LowerScale.Maximum = 0.9;

For the first membership function of output 1, set the tunable range of the lower membership function lag to be between 0.1 and 0.4.

in(2).MembershipFunctions(1).LowerLag.Minimum = 0.1;
in(2).MembershipFunctions(1).LowerLag.Maximum = 0.4;

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

Fuzzy inference system, specified as a mamfis, sugfis, mamfistype2, sugfistype2, or fistree object. The fuzzy system can be a fuzzy inference system or network of interconnected fuzzy inference systems.

Output Arguments

collapse all

Tunable settings for input variables, returned as an array of VariableSettings objects. Each VariableSettings object contains tunability settings for the input variable indicated by its FISName and VariableName properties.

Specify the tunability settings of the membership functions for this variable, using its MembershipFunctions property.

Tunable settings for input variables, returned as an array of VariableSettings objects. Each VariableSettings object contains tunability settings for the output variable indicated by its FISName and VariableName properties.

Specify the tunability settings of the membership functions for this variable, using its MembershipFunctions property.

Tunable settings for rules, returned as an array of RuleSettings object. Each RuleSettings object contain tunability settings for a rule from the FIS indicated by its FISName property.

Specify the tunability settings of the antecedent and consequent for this variable, using its Antecedent and Consequent properties, respectively.

Introduced in R2019a