This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

addOutput

Add output variable to fuzzy inference system

Syntax

fisOut = addOutput(fisIn)
fisOut = addOutput(fisIn,range)
fisOut = addOutput(___,Name,Value)

Description

example

fisOut = addOutput(fisIn) adds a default output variable to fisIn, and returns the resulting fuzzy system in fisOut. This output variable has a default name, default range, and no membership functions.

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

example

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

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: [0x0 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 = 
  1x3 fismf array with properties:

    Name
    Type
    Parameters

  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 a mamfis or sugfis object.

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 Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'NumMFs',3 configures the variable to use three membership functions

Variable name, specified as the comma-separated pair consisting of 'Name' and a string or character vector.

Number of membership functions, specified as the comma-separated pair consisting of 'NumMFs' and a nonnegative integer.

Membership function type, specified as the comma-separated pair consisting of 'MFType' and one of the following:

  • "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.

Output Arguments

collapse all

Fuzzy inference system, returned as a mamfis or sugfis object. fisOut contains the added output variable, with all other properties matching the properties of fisIn.

Introduced in R2018b