Main Content

Define Membership Functions Using Fuzzy Logic Designer

Once you add a variable to your fuzzy inference system (FIS) using Fuzzy Logic Designer, you can define the membership functions for that variable.

Add MFs

To add membership functions to a given variable, select the variable in the System Browser or click the variable in the Fuzzy Inference System document. In the Property Editor, the app shows the input variable and membership function properties.

App showing an input variable selected in the System Browser on the left and in the Fuzzy Inference System Plot document in the center. The Property Editor on the left shows the variable properties, including an empty MF table.

To add an MF, on the Design tab, in the Add Components gallery, click MF.

App toolstrip with the MF option listed as the only option in the Add Components gallery

In the System Browser, the app adds an MF with a default configuration to the selected variable. You can view the properties of the MF in the table of the Property Editor

App showing the new MF highlighted in the System Browser. The MF table in the property editor shows the new MF with name mf1, a triangular type, and default parameters [0 0.5 1].

You can also create a copy of an existing MF. To do so, in the System Browser, under the variable, right-click the membership function and select Add a copy.

System Browser showing the right-click menu for an MF. The cursor is over the Add a copy menu item.

The app creates a new MF with the same properties as the original MF and a modified name.

View MFs

To view a plot of the membership functions for a given variable, first select the variable in the System Browser. Then, open the Membership Function Editor document.

App showing the service variable selected in the System Browser on the right. In the center, the Membership Function Editor document shows three Gaussian MFs. In the Property Editor on the right, the MF table lists the properties for these MFs: poor with parameters [1.5 0], good with parameters [1.5 5], and excellent with parameters [1.5 10].

You can view the properties of the MFs in the Property Editor.

Configure MFs

You can edit the properties of an MF in the Property Editor. The types of MFs available for a variable and the MF properties depend on the type of FIS that you are designing.

Type-1 MFs

The following variables use type-1 MFs.

  • Input and output variables of a type-1 Mamdani FIS

  • Input variables of a type-1 Sugeno FIS

To configure a type-1 MF, specify the following properties.

  • Name — Membership function name

  • Type — Membership function type

  • Parameters — Membership function parameters

Property Editor showing variable properties, including a table of MFs. For a variable with type-1 MFs, the table has three columns, listed from left to right: Name, Type, and Parameters.

You can specify the built-in type-1 MFs in the following table.

TypeDescriptionMore Information
Generalized bellGeneralized bell-shaped membership functiongbellmf
GaussianGaussian membership functiongaussmf
Two-sided GaussianGaussian combination membership functiongauss2mf
TriangularTriangular membership functiontrimf
TrapezoidalTrapezoidal membership functiontrapmf
Linear S-shapedLinear s-shaped saturation membership functionlinsmf
Linear Z-shapedLinear z-shaped saturation membership functionlinzmf
SigmoidalSigmoidal membership functionsigmf
Difference of sigmoidsDifference between two sigmoidal membership functionsdsigmf
Product of sigmoidsProduct of two sigmoidal membership functionspsigmf
Z-shapedZ-shaped membership functionzmf
Pi-shapedPi-shaped membership functionpimf
S-shapedS-shaped membership functionsmf

You can also specify custom MFs. For more information, see Build Fuzzy Systems Using Custom Functions.

Type-2 MFs

The following variables use type-2 MFs.

  • Input and output variables of a type-2 Mamdani FIS

  • Input variables of a type-2 Sugeno FIS

To configure a type-2 MF, specify the following properties.

  • Name — Membership function name

  • Type — Membership function type

  • Upper Parameters — Upper membership function parameters

  • Lower Scale — Lower membership function scale factor

  • Lower Lag — Lower membership function delay factor, which defines the point at which the lower membership function value starts increasing from zero based on the value of the upper membership function. For example, a lag value of 0.1 indicates that the lower membership function becomes positive when the upper membership function has a membership value of 0.1

Property Editor showing variable properties, including a table of MFs. For a variable with type-2 MFs, the table has five columns, listed from left to right: Name, Type, Upper Parameters, Lower Scale, and Lower Lag.

A type-2 MF consists of a type-1 upper MF and a scaled lower MF. The Type and Upper Parameters properties define the upper MF and correspond to the Type and Parameters properties of a type-1 MF.

For more information on type-2 MFs, see Type-2 Fuzzy Inference Systems.

Sugeno Output MFs

For the output variables of type-1 and type-2 Sugeno systems, you can specify the following types of MFs.

  • Constant — The location of the singleton MF in the output range is a constant value.

  • Linear — The location of the singleton MF in the output range is a linear function of the input values.

For these membership functions, you can specify the following parameters.

  • Name — Membership function name

  • Type — Membership function type

  • Parameters — Membership function parameters

Property Editor showing variable properties, including a table of MFs. For an output variable of a Sugeno system, the table has three columns, listed from left to right: Name, Type, and Parameters.

For more information on Sugeno systems, see Sugeno Fuzzy Inference Systems.

Interactively Edit MFs

You can also interactively adjust the properties of a built-in type-1 or type-2 MF. To do so, in the Membership Function Editor, first click the MF. Then, you can modify the MF by dragging the control points.

Type-1 triangular MF selected in Membership Function Editor with arrows indicating where to drag the control point at the triangle peak

Interactively editing a Sugeno output MF or a custom MF is not supported.

Delete MFs

To delete an MF from a variable, in the System Browser, under the variable, right-click the membership function and select Delete.

System Browser showing the right-click menu for an MF. The cursor is over the Delete menu item.

When you delete an MF from a variable, any rules that contain that variable are also deleted.

See Also

Related Topics