Define Fuzzy Rules Using Fuzzy Logic Designer
Once you create a fuzzy inference system (FIS) using Fuzzy Logic Designer and define the input and output variables along with their respective membership functions, you can create a fuzzy rule base for your system.
Each if-then rule in a fuzzy system has two components.
Antecedent — The if portion of the rule, which specifies the input variable linguistic terms
Consequent — The then portion of the rule, which specifies the output variable linguistic terms
For more information on fuzzy rule structure, see Foundations of Fuzzy Logic.
Once you define your rules, you can analyze the behavior of your FIS, including the rule inference process. For more information, see Analyze Fuzzy System Using Fuzzy Logic Designer.
Add Rules
To add a rule to your FIS, first open the Rule Editor document.
To add a rule, click . The app adds a default rule to the rule table and shows the rule properties in the Property Editor. You can then edit the rule properties using the Property Editor.
You can copy an existing rule by selecting the rule in the Rule Editor and clicking .
You can also add a rule by selecting either the FIS name or Rules in the System Browser. Then, on the Design tab, in the Add Components gallery, click Rule.
Add All Possible Rules
You can add AND-based rules to your FIS for all possible input combinations using one of the following methods:
In the Rule Editor, click Add All Possible Rules.
Select the FIS name or Rules in the System Browser. Then, in the Add Components gallery, click Add All Rules.
Edit Rules
To configure a rule, first select the rule in the System Browser or the Rule Editor, which displays the rule in the Property Editor.
To define the rule antecedent, first specify the connection operator. To do so, set the Connection parameter to one of the following values.
And — Connect the input linguistic terms using an AND operation.
Or — Connect the input linguistic terms using an OR operation.
Then, under If, select a linguistic term for each input variable.
To do so, in the right-hand drop-down list, select a membership function name. To ignore an
input variable, select none
.
Then, indicate whether to apply a NOT operation to the selected membership function. To
apply a NOT operation, in the left-hand drop-down list, select is
not
. Otherwise, select is
.
Similarly, under Then configure each output variable in the consequent.
Typically, you weight the importance of all the rules in a FIS equally. However, you can
decrease the relative weighting of a rule. To do so, specify a value for the
Weight parameter that is less than 1
.
Delete Rules
To delete a rule from your FIS, in the Rule Editor, select the rule and click
Alternatively, in the System Browser, under Rules, right-click the rule and select Delete.
To delete all of the rules from your FIS, in the Rule Editor, click Clear All Rules.
Alternatively, in the System Browser, right-click Rules, and select Delete all rules.