Update fuzzy rule using fuzzy inference system
Create a fuzzy rule using a verbose text description.
rule = fisrule("if service is poor and food is delicious then tip is average (1)");
Alternatively, you can specify the same rule using a symbolic text description.
rule = fisrule("service==poor & food==delicious => tip=average")
rule = fisrule with properties: Description: "service==poor & food==delicious => tip=average (1)" Antecedent: [] Consequent: [] Weight: 1 Connection: 1
Before using rule
with a fuzzy system, update the rule Antecedent
and Consequent
properties using the update
function.
fis = readfis("tipper");
rule = update(rule,fis)
rule = fisrule with properties: Description: "service==poor & food==delicious => tip=average (1)" Antecedent: [1 2] Consequent: 2 Weight: 1 Connection: 1
Create a fuzzy rule using a numeric description. Specify that the rule has two input variables.
rule = fisrule([1 2 2 0.5 1],2)
rule = fisrule with properties: Description: "input1==mf1 & input2==mf2 => output1=mf2 (0.5)" Antecedent: [1 2] Consequent: 2 Weight: 0.5000 Connection: 1
Before using rule
with a fuzzy system, update the rule Description
property using the update
function.
fis = readfis("tipper");
rule = update(rule,fis)
rule = fisrule with properties: Description: "service==poor & food==delicious => tip=average (0.5)" Antecedent: [1 2] Consequent: 2 Weight: 0.5000 Connection: 1
ruleIn
— Fuzzy rulefisrule
object | array of fisrule
objectsFuzzy rule, specified as a fisrule
object
or an array of fisrule
objects. If ruleIn
was
created using a:
Text description, its Antecedent
and
Consequent
properties are updated using the input and output
membership function indices in fis
that correspond to the
membership function names in the Description
property of
ruleIn
Numeric description, its Description
property is updated
using the input and output membership function names in fis
that correspond to the membership function indices in the
Antecedent
and Consequent
properties of
ruleIn
If you specify ruleIn
as an array of
fisrule
objects, then all of the rules are updated accordingly.
fis
— Fuzzy inference systemmamfis
object | sugfis
object | mamfistype2
object | sugfistype2
objectFuzzy inference system, specified as one of the following:
mamfis
object — Mamdani fuzzy inference system
sugfis
object — Sugeno fuzzy inference system
mamfistype2
object — Type-2 Mamdani fuzzy inference system
sugfistype2
object — Type-2 Sugeno fuzzy inference system
ruleOut
— Fuzzy rulefisrule
object | array of fisrule
objectsFuzzy rule, returned as a fisrule
object or an array of
fisrule
objects.
You have a modified version of this example. Do you want to open this example with your edits?