Function File: fis = addvar (fis, in_or_out, var_name, var_range)

Add an input or output variable to an existing FIS structure and return the updated FIS.

The types of the arguments are expected to be:

  • fis - an FIS structure
  • in_or_out - either ’input’ or ’output’ (case-insensitive)
  • var_name - a string
  • var_range - a vector [x1 x2] of two real numbers

The vector components x1 and x2, which must also satisfy x1 <= x2, specify the lower and upper bounds of the variable’s domain.

To run the demonstration code, type demo('addvar') at the Octave prompt.

Demonstration 1

The following code

 a = newfis ('Heart-Disease-Risk', 'sugeno', ...
             'min', 'max', 'min', 'max', 'wtaver');
 a = addvar (a, 'input', 'LDL-Level', [0 300]);
 getfis (a, 'input', 1);

Produces the following output

Name = LDL-Level
NumMFs = 0
MFLabels = 
Range = [0 300]

Package: fuzzy-logic-toolkit