plotmf

Plot membership functions for input or output variable

Syntax

plotmf(fis,variableType,variableIndex)
plotmf(___,numPoints)
[xOut,yOut] = plotmf(___)

Description

example

plotmf(fis,variableType,variableIndex) plots the membership functions for an input or output variable in the fuzzy inference system fis.

example

plotmf(___,numPoints) specifies the number of data points to plot for each membership function.

example

[xOut,yOut] = plotmf(___) returns the x-axis and y-axis data for the membership functions without plotting them.

Examples

collapse all

Create a fuzzy inference system.

fis = readfis('tipper');

Plot the membership functions for the first input variable.

plotmf(fis,'input',1)

Create a fuzzy inference system.

fis = readfis('tipper');

Plot the membership functions for the first output variable using 101 data points for each membership function.

plotmf(fis,'output',1,101)

Create a fuzzy inference system.

fis = readfis('tipper');

Obtain the x-axis and y-axis data for the membership functions of the second input variable.

[xOut,yOut] = plotmf(fis,'input',2);

You can then, for example, plot a single membership function using this data.

plot(xOut(:,2),yOut(:,2))
xlabel('food')
ylabel('delicious membership')

Input Arguments

collapse all

Fuzzy inference system, specified as a mamfis or sugfis object. Construct fis at the command line or using the Fuzzy Logic Designer. For more information, see Build Fuzzy Systems at the Command Line and Build Fuzzy Systems Using Fuzzy Logic Designer.

plotmf does not support plotting output membership functions of Sugeno systems.

Variable type, specified as one of the following:

  • 'input' — Input variable

  • 'output' — Output variable

Variable index, specified as a positive integer. If variableType is:

  • 'input', then variableIndex must be less than or equal to the number of input variables in fis

  • 'output', then variableIndex must be less than or equal to the number of output variables in fis

Number of data points to plot, specified as a positive integer.

Output Arguments

collapse all

Plot x-axis data, returned as a numPoints-by-NMF array, where NMF is the number of membership functions for the variable specified by variableType and variableIndex.

Plot y-axis data, returned as a numPoints-by-NMF array, where NMF is the number of membership functions for the variable specified by variableType and variableIndex.

Compatibility Considerations

expand all

Not recommended starting in R2018b

See Also

Functions

Introduced before R2006a