addvar

(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.

Syntax

fis = addvar(fis,varType,varName,varBounds)

Description

addvar has four input arguments:

  • fis — Fuzzy inference system in the MATLAB® workspace, specified as a FIS structure.

  • varType — Type of variable to add, specified as 'input' or 'output'.

  • varName — Name of the variable to add, specified as a character vector or string.

  • varBounds — 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.

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

Examples

collapse all

Create new FIS.

fis = newfis('tipper');

Add new input variable.

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

View new variable properties.

getfis(fis,'input',1)
ans = struct with fields:
      Name: 'service'
    NumMFs: 0
     range: [0 10]

Compatibility Considerations

expand all

Not recommended starting in R2018b

Introduced before R2006a