Main Content

plotfis

Display fuzzy inference system

Description

plotfis(fis) displays a high-level diagram of a fuzzy inference system (FIS).

  • When fis is a Mamdani or Sugeno FIS, the center of the display shows the name, type, and rule count for the FIS. The input variables with their associated membership functions are displayed on the left, and the outputs with their associated membership functions are displayed on the right.

  • When fis is a FIS tree, the display shows the inputs, outputs, component FIS objects, and connections of the specified FIS tree.

example

plotfis(fis,Name=Value) configures display properties using one or more name-value arguments.

example

Examples

collapse all

Create a fuzzy inference system (FIS). For this example, read the FIS from the tipper.fis file.

fis = readfis('tipper');

Display the fuzzy system.

plotfis(fis)

Figure contains 5 axes objects. Axes object 1 with xlabel service (3) contains 3 objects of type line. Axes object 2 with xlabel food (2) contains 2 objects of type line. Axes object 3 with xlabel tip (3) contains 3 objects of type line. Axes object 4 with xlabel tipper (3 ) contains an object of type text. Hidden axes object 5 with xlabel System tipper: 2 inputs, 1 outputs, 3 rules contains 3 objects of type line.

The figure shows the FIS name and type, along with the number of rules. Also, for each input and output variable, the name and membership function configuration are shown.

Since R2021b

Load a FIS tree for a weighted tipper system with three inputs and one output.

load("weightedTipper")

Display the fistree object with a legend.

plotfis(weightedTipper,Legend="on")

In this display, free inputs are the inputs without any incoming connections. You must specify these inputs when you evaluate the FIS tree. The free and intermediate output values are returned when you evaluate the FIS tree.

You can also plot the FIS tree without a legend.

plotfis(weightedTipper)

Since R2024b: To further analyze the intermediate FIS behavior, you can view the data propagation through the system for specified input values. For example, view the propagation of inference results for a food quality rating of 8, service quality rating of 3, and weighting factor of 0.2.

plotfis(weightedTipper,SimulationInputs=[8 0.2 3])

The plot shows the intermediate inference results. For example, the foodFIS system reduces the food rating based on the weighting factor.

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 (since R2021b)

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: plotfis(fisT,Legend="on") displays a legend in the plot of FIS tree fisT

Since R2021b

Option to display legend for FIS tree plot, specified as "off" or "on". When Legend is "on", the FIS plot displays information about the inputs, outputs, and connections of the specified fistree object by adding a legend to the display.

Dependencies

This argument applies only when fis is a fistree object.

Since R2024b

Input values for evaluating FIS, specified as a vector with length equal to the number of inputs in fis. When you specify SimulationInputs, the FIS plot displays the propagation of inference results through fis for the specified input values.

Since R2024b

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

Dependencies

This argument is ignored when SimulationInputs is empty.

Alternative Functionality

App

You can interactively view the high-level structure of a FIS using the Fuzzy Logic Designer app.

Version History

Introduced before R2006a

expand all