Main Content


(To be removed) Add variable to fuzzy inference system

    addvar will be removed in a future release. Use addInput or addOutput instead. For more information, see Compatibility Considerations.



    outfis = addvar(infis,varType,varName,varRange) adds an input or output variable to the fuzzy system infis with the specified name and range.

    Indices are applied to variables in the order in which they are added. For example, the first input variable added to a system is input variable number one for that system. Input and output variables are numbered independently.


    collapse all

    Create a new FIS.

    fis = newfis('tipper');

    Add a new input variable.

    fis = addvar(fis,'input','service',[0 10]);

    View new variable properties.

    ans = struct with fields:
          Name: 'service'
        NumMFs: 0
         range: [0 10]

    Input Arguments

    collapse all

    Fuzzy system, specified as a FIS object.

    Variable type, specified as either 'input' or 'output'.

    Variable name, specified as a string or character vector.

    Variable range, specified as a two-element vector, where the first element is the minimum value and the second element is the maximum value for the variable.

    Output Arguments

    collapse all

    Updated fuzzy system, returned as a FIS object.

    Version History

    Introduced before R2006a

    expand all

    R2019b: Support for fuzzy inference system structures will be removed

    Support for representing fuzzy inference systems as structures will be removed in a future release. Use mamfis and sugfis objects with this function instead. To convert existing fuzzy inference system structures to objects, use the convertfis function.

    This change was announced in R2018b. Using fuzzy inference system structures with this function issues a warning starting in R2019b.