Main Content

plotrule

Visualize rule inference process for fuzzy inference system

Since R2024b

    Description

    plotrule(fis) displays a rule inference diagram for fuzzy inference system fis. This syntax uses the midpoint of each input range as the corresponding input value. The inference diagram shows how the fuzzy system computes a crisp output value using the following steps:

    1. Fuzzify inputs using rule antecedents.

    2. Determine rule firing strengths based on fuzzy input values and antecedent operators.

    3. Determine output fuzzy set for each rule using implication.

    4. Aggregate the fuzzy sets from all rules into a single fuzzy set.

    5. Calculate a crisp output value by defuzzification of the aggregated fuzzy set.

    plotrule(fis,Name=Value) configures the rule inference plot using one or more name-value arguments.

    example

    Examples

    collapse all

    Load a fuzzy inference system.

    fis = readfis("tipper");

    View the rule inference diagram for a service rating of 8 and a food rating of 4;

    plotrule(fis,Inputs=[8 4])

    Figure contains 10 axes objects. Axes object 1 with title service=8, ylabel 1 contains 3 objects of type line. Axes object 2 with title food=4 contains 3 objects of type line. Axes object 3 with title tip=22.2115, ylabel OR (max) contains 3 objects of type line, patch. Axes object 4 with ylabel 2 contains 3 objects of type line. Axes object 5 is empty. Axes object 6 with ylabel AND (min) contains 3 objects of type line, patch. Axes object 7 with ylabel 3 contains 3 objects of type line. Axes object 8 contains 3 objects of type line. Axes object 9 with ylabel OR (max) contains 3 objects of type line, patch. Axes object 10 contains 2 objects of type patch, line.

    Input Arguments

    collapse all

    Fuzzy 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

    Name-Value Arguments

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: Inputs=[0.2 0.3] sets the inputs of a two-input FIS to 0.2 and 0.3.

    Input values for evaluating FIS, specified as a vector with length equal to the number of inputs in fis. If you do not specify input values, plotrule uses the midpoint of each input range as their respective input values.

    Number of sample points for output defuzzification when , specified as an integer greater than 1.

    Dependencies

    plotrule ignores this property when evaluating a Sugeno FIS.

    Alternative Functionality

    App

    You can interactively view the rule inference process for a FIS using the Fuzzy Logic Designer app. For more information, see Analyze Fuzzy System Using Fuzzy Logic Designer.

    Version History

    Introduced in R2024b