Main Content

plotfiserr

Plot simulation error for fuzzy system compared to reference outputs

Since R2024b

    Description

    plotfiserr(fis,x,y) simulates fuzzy inference system fis using the reference input values in x and visualizes the output error with respect to the reference outputs in y. For a FIS with multiple outputs, this syntax analyzes the error for the first output.

    example

    plotfiserr(fis,x,y,Name=Value) configures the simulation error plot using one or more name-value arguments.

    Examples

    collapse all

    Load a Mamdani fuzzy inference system.

    fisM = readfis("tipper");

    Create a Sugeno version of the same fuzzy system.

    fisS = convertToSugeno(fisM);

    Create random reference input values.

    x = 10*rand(100,2);

    Compute reference output values using fisM.

    y = evalfis(fisM,x);

    Evaluate fisS and plot the error distribution with respect to the output from fisM.

    plotfiserr(fisS,x,y)

    Figure contains an axes object. The axes object with xlabel service, ylabel food contains an object of type scatter.

    The largest errors are in the following regions:

    • High service rating and low food rating

    • High food rating and low service rating

    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

    • fistree object — Tree of interconnected fuzzy inference systems

    Reference input values, specified as an M-by-NX array, where M is the number of reference data points and NX is the number of inputs in fis.

    Reference output values, specified as an M-by-NY array, where M is the number of reference data points and NY is the number of outputs in fis.

    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: SelectedOutput=2 selects the second FIS output for analysis.

    Output variable to analyze, specified as a positive integer less than or equal to the number of outputs in fis.

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

    Dependencies

    plotfiserr ignores this property when evaluating a Sugeno FIS.

    Alternative Functionality

    App

    You can interactively view FIS simulation errors using the Fuzzy Logic Designer app. For more information, see Analyze Fuzzy System Using Fuzzy Logic Designer.

    Version History

    Introduced in R2024b