Main Content

addOutput

Add output variable to fuzzy inference system

Description

fis = addOutput(fis) adds an output variable to fis. This output variable has a default name, default range, and no membership functions. No other properties of fis are changed.

example

fis = addOutput(fis,range) adds an output variable with the specified range.

fis = addOutput(___,Name=Value) configures the output variable using one or more name-value arguments.

example

Examples

collapse all

Create a Mamdani fuzzy inference system.

fis = mamfis(Name="tipper");

Add an output variable with default specifications.

fis = addOutput(fis);

You can configure the output variable properties using dot notation. For example, specify the name and range for the variable.

fis.Outputs(1).Name = "tip";
fis.Outputs(1).Range = [10 30];

View the output variable.

fis.Outputs(1)
ans = 
  fisvar with properties:

                   Name: "tip"
                  Range: [10 30]
    MembershipFunctions: [0×0 fismf]

You can also specify the variable name and range when you add it to the fuzzy system.

fis2 = mamfis(Name="tipper");
fis2 = addOutput(fis2,[10 30],Name="tip");

Create a Sugeno fuzzy inference system.

fis = sugfis(Name="tipper");

Add an output variable with three constant membership functions distributed over the output range.

fis = addOutput(fis,NumMFs=3,MFType="constant");

View the membership functions.

fis.Outputs(1).MembershipFunctions
ans = 
  1×3 fismf array with properties:

    Type
    Parameters
    Name

  Details:
         Name        Type       Parameters
         _____    __________    __________

    1    "mf1"    "constant"         0    
    2    "mf2"    "constant"       0.5    
    3    "mf3"    "constant"         1    

Input Arguments

collapse all

Fuzzy inference system, specified as one of these objects:

  • mamfis — Mamdani fuzzy inference system

  • sugfis — Sugeno fuzzy inference system

  • mamfistype2 — Type-2 Mamdani fuzzy inference system

  • sugfistype2 — Type-2 Sugeno fuzzy inference system

Variable range, specified as a two-element element vector where the first element is less than the second element. The first element specifies the lower bound of the range, and the second element specifies the upper bound of the range.

Name-Value Arguments

collapse all

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: fis = addOutput(fis,NumMFs=3)

Variable name, specified as a string or character vector.

Number of membership functions, specified as a nonnegative integer.

Membership function type, specified as one of the following values.

  • "trimf" — Triangular membership functions for the outputs of Mamdani system

  • "gaussmf" — Gaussian membership functions for the outputs of Mamdani systems

  • "constant" — Constant membership functions for the outputs of Sugeno systems

  • "linear" — Linear membership functions for the outputs of Sugeno systems. To add an output variable with linear membership functions, your FIS must have at least one input variable.

The membership functions are uniformly distributed over the variable range with approximately 80% overlap in the membership function supports.

Version History

Introduced in R2018b

expand all